Developers’ Weblog

Sponsored by
HostEurope Logo

Developers’ Weblog

All 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

Today I learned something about file encodings in vim. When your terminal is UTF-8 but Vim insists on treating the file you are opening as latin-1, here is what to do: Setting fileencoding on the already opened file will not work, it will only try to convert the file (i.e. the wrongly interpreted UTF-8 sequences) to UTF-8. Don't do this!

The solution is to reopen the file using

:e ++enc=utf8

or specify the ++enc parameter when opening the file from inside vim. The more you know.

MirOS Logo