Skip to content

Commit bd7117e

Browse files
k-takatacxw42
authored andcommitted
Convert UTF-8 to 'encoding'
`readfile()` doesn't convert the encoding of the file. Convert it manually when 'encoding' is not UTF-8.
1 parent 9e56d57 commit bd7117e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

autoload/editorconfig_core/ini.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ function! editorconfig_core#ini#read_ini_file(config_filename, target_filename)
7171
if len(l:lines) > 0 && l:lines[0][:2] ==# "\xEF\xBB\xBF"
7272
let l:lines[0] = l:lines[0][3:]
7373
endif
74+
" convert from UTF-8 to 'encoding'
75+
call map(l:lines, 'iconv(v:val, "utf-8", &encoding)')
7476
endif
7577
let result = s:parse(a:config_filename, a:target_filename, l:lines)
7678
catch

0 commit comments

Comments
 (0)