Skip to content

Commit

Permalink
add windows iconv
Browse files Browse the repository at this point in the history
  • Loading branch information
cyyever committed Nov 2, 2024
1 parent 4fca382 commit 94bb9fd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions autoload/ale.vim
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,15 @@ function! ale#GetLocItemMessage(item, format_string) abort
" Windows may insert carriage return line endings (^M), strip these characters.
let l:msg = substitute(l:msg, '\r', '', 'g')

if has('win32')
let l:to = &encoding
if l:to ==# 'utf-8'
let l:res = iconv(l:msg, 'default', l:to)
if l:res !=# '' && stridx(l:res, '?') == -1
let l:msg=l:res
endif
endif
endif
return l:msg
endfunction

Expand Down

0 comments on commit 94bb9fd

Please sign in to comment.