Assume that your
vimrc has the following settings.
set encoding=utf-8 set termencoding=utf-8 set fileencodings=ucs-bom,euc-jp,cp932,iso-2022-jp
If you write the following phrase and save it,
and then you will see a bafflegab after re-open the file by
:e. (You can resolve the bafflegab by
If there's other good words, for example 'あ', bafflegab will never appear.
Of course nobody can type
:e ++enc=utf8 no matter when open the file. There are two easy solutions.
- Add BOM.
- Add other words if it's possible.
modeline won't help the problem.