'encoding' should not be changed except at the start of your vimrc,
before loading any file, because otherwise it can have far-reaching
effects everywhere in your Vim session, potentially making
already-loaded text unreadable or corrupt.
I recommend to se 'encoding' to UTF-8 once and for all, see
http://vim.wikia.com/wiki/Working_with_Unicode
Not every file-encoding can be automagically identified by Vim; in
particular, East-Asian encodings aren't easy to recognize
automatically. Now and then you'll meet one which Vim cannot detect,
and in that case it will usually fall back to Latin1.
But if you know what encoding the file uses, you can tell Vim, see
":help ++opt". For instance, if you know that file "filename.ext" is
in cp936, you can open it in a new window with
:new ++enc=cp936 filename.ext
Of course, if you _don't_ know which one of a possible limited set of
encodings your file is in, you might find it out by trial and error,
by using the various encodings (starting with the most likely one) as
the argument of ++enc=
This may require +iconv, which is usually compiled-in with multibyte
versions of Vim but may require an additional external library if it
wasn't statically included in your Vim binary. (If ":echo
has('iconv')", without the double quotes but with the single ones,
answers 1, then you've got it and any necessary library was found. If
it answers 0, then either iconv wasn't compiled-in, or, if dynamically
included, the library wasn't found by Vim at runtime.)
Or, since cp936 is a Windows encoding (see
https://en.wikipedia.org/wiki/Code_page_1386 ), if your Unix/Linux
system does not know about cp936 you might have more luck with
GB18030, which is the new official PRC standard and supersedes it.
IIUC it is a superset of cp936, see
https://en.wikipedia.org/wiki/GB_18030
Best regards,
Tony.
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit
http://www.vim.org/maillist.php
>
> --- You received this message because you are subscribed to the Google
> Groups "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
vim_dev+u...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.