Ben Fritz wrote:

> On Jan 29, 6:46 am, Christian Brabandt <[email protected]> wrote:
> > Hi Vlad!
> >
> > On Fr, 28 Jan 2011, Vlad Irnov wrote:
> >
> > > Vim apparently uses cp1252 instead of latin-1 for &enc. My
> > > understanding is
> > > that the only difference between them is that cp1252 has characters
> > > for bytes
> > > 128-159 while latin-1 uses them as control characters.
> >
> > Yes, if I read mbyte.c correctly, vim assumes cp1252 and uses this
> > encoding for latin1 and iso8859-1
> >
> 
> If this is true, I think the :help should mention it. As Vlad
> mentions, this practice is fairly common so I don't think it will be
> surprising to anyone as long as it is documented. I wonder though, if
> pretending to be in latin1 but really being in cp1252 might cause more
> headaches than it solves.

I have added a remark in the help file.  The main reason to do this is
that conversion between cp1252 and latin1 doesn't really work, thus
naming them differently would cause lots of conversion errors.

> Note that this is the case for 'encoding' but not for 'fileencoding'.
> 'fileencoding' seems to really use latin1.
> 
> @Vlad, yes I noticed this behavior also for em dash and another
> character (I forget which one). The project I am working on uses
> latin1 for code and such, and probably needs to continue doing so. The
> only place I'm using these characters are in personal TODO or notes
> files. I was surprised when I saw it was working when all indications
> were that it should not.
> 
> I have rules in my .vimrc to use utf-8 as my encoding but latin1 for
> the fenc of most files, unless the file contains any of the bytes
> which are characters in cp1252 but not in latin1.

-- 
If Microsoft would build a car...
... The airbag system would ask "are you SURE?" before deploying.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
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

Raspunde prin e-mail lui