Re: Document encoding autodetection
- DukO <duko@...> wrote:
> Hello all,ISO-8859-2, cp1250 and latin1 are 3 different 8-bit encodings. Since there
> I'm running RH9 machine with UTF-8 encoding as the "core" one.
> Time to time I'm editing documents in ISO-8859-2 and CP-1250
> encoding. To make my life easier, I've put into my .vimrc file
> the following line:
> set fileencodings=utf-8,iso-8859-2,cp1250,latin1
> Well, but it doesn't work as I can't see properly some characters.
> Probably the autodetection fails or selects wrong encoding.
> Nevertheless, if I let the .vimrc file like:
> set fileencodings=utf-8,latin1
> and use command:
> e ++enc=cp1250 <filename>
> then it works OK, but it is too clumsy. Is there any way out?
> Dusan Kolar
is no possible "failure" for detecting an 8-bit encoding via the
'fileencodings' option, it is not possible to autodetect more than one of
them. Your 'fileencodings' will never autodetect cp1250 or latin1 because of
this limitation. But if you use ++enc with the proper encoding, it should
work, as you noted.
and scroll down to WRONG VALUES: (a forward search on WRONG might help).
Removing and adding encodings with something like
changing the last line as necessary, would IMHO be even more clumsy, unless
you had a whole bunch of files to edit sharing the same encoding.