Skip to content

Commit

Permalink
Add Windows iconv conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
cyyever committed Nov 2, 2024
1 parent 4fca382 commit f21795f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions autoload/ale.vim
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,18 @@ 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 is# 'utf-8'
let l:res = iconv(l:msg, 'default', l:to)

if l:res isnot# '' && stridx(l:res, '?') == -1
let l:msg=l:res
endif
endif
endif

return l:msg
endfunction

Expand Down

0 comments on commit f21795f

Please sign in to comment.