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 fdc7fcc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions autoload/ale.vim
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,20 @@ 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

" Given a buffer and a linter or fixer name, return an Array of two-item
Expand Down

0 comments on commit fdc7fcc

Please sign in to comment.