If you are editing a file encoded as latin1, you will find that the "fileencoding" for this buffer is set to latin1. Therefore, before saving the file, you must manually install the file.
:set fileencoding=utf8 :w myfilename
Also note that UTF8 files often start with a Byte Order (BOM) sign, which indicates accuracy. the specification is optional, but some programs use it solely to determine the encoding of the file. Under certain conditions, Vim will write a specification, but sometimes it will not. To explicitly establish a specification, do the following:
:set bomb
For more information :help mbyte-options and :help utf8 and :help bomb .
Eric Johnson Feb 16 '12 at 11:14 2012-02-16 11:14
source share