On Sun, Jul 27, 2003 at 03:33:15PM +0300, Beni Cherniavsky wrote:
> Herouth Maoz wrote on 2003-07-27:
> 
> > As for vi, I'm a bit mystified about this myself - I removed UTF8 from every
> > localization file in my system, and still vi opens up with a default file
> > encoding of utf8.
> >
> > Each program has its own behaviour, however. Take vi - it has an encoding, and
> > then, a file encoding. As it is, I changed the encoding to iso8859-8 in its
> > vimrc. So when it reads a plain ascii file it assumes a file encoding of utf-8
> > and does a (useless) conversion. If, however, the file contains Hebrew
> > characters in ISO8859-8, it interprets it as an unknown encoding, and loads it
> > up just fine... Each program has such quirks.
> >

According to vim's help is uses the environment settings (see ":h
locale" and onwards, and specifically ":h encoding-table"

Heruth: are you sure you have a proper ISO-8859-8 LC_CTYPE? WorksForMe
on debian-unstable: by default it uses UTF-8, but |I can use 'LANG=he_IL
gvim -fn heb8x13' to get gvim with 8bit Hebrew.

> Wild guess: vi is trying to autodetect UTF-8.  The probability of a
> file in non-ascii encoding other than UTF-8 to be decodable as valid
> UTF-8 is very low (except for extremely short text or texts with very
> few non-ascii characters).  

There should be some auto-detection. But generally the environment is
used first.

-- 
Tzafrir Cohen                       +---------------------------+
http://www.technion.ac.il/~tzafrir/ |vim is a mutt's best friend|
mailto:[EMAIL PROTECTED]       +---------------------------+

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to