Developers’ Weblog

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.