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 :e ++enc=utf8
.)
If there's other good words, for example 'あ', bafflegab will never appear.
Solution
Of course nobody can type :e ++enc=utf8
no matter when open the file. There are two easy solutions.
- Add BOM.
:setl bomb
and:w
. - Add other words if it's possible.
Note that modeline
won't help the problem.
No comments:
Post a Comment