[EMAIL PROTECTED] wrote:
Hello,

Recently I want to do some research about 'fileencodings', what I want is
to recognize utf-8, ucs-2le, euc-cn and cp936 encodings.

So I set the 'fencs' in my .vimrc:
set fencs=ucs-bom,utf-8,ucs-2le,euc-cn,cp936

However, cp936 files are always recognized as ucs-2le and I got everything
in a mess...
If I remove the ucs-2le:
set fencs=ucs-bom,utf-8,euc-cn,cp936

That would work, but ucs-2le files cannot get recognized at all.

It is said that unicode files all have BOM, and obviously cp936 files do
not have BOM, so I wonder why cp936 files get recognized as ucs-2le file
without any BOM.

probably because the cp936 files you tested do not contain any sequence of bytes that would be illegal under UCS-2le.


I tried to change my 'encoding' setting, but it doesn't affect anything.

Any hints?
--
Sincerely, Pan, Shi Zhu. ext: 2606


Unicode files may or may not have a BOM, depending on who (or which program) created them and where they come from. If you remove "ucs-2le" from your 'fileencodings', but leave "ucs-bom" at the start, any Unicode files having a BOM will still be recognised and the proper encoding set.


Best regards,
Tony.
--
Cahn's Axiom:
        When all else fails, read the instructions.

Reply via email to