On Fri, Mar 21, 2014 at 10:38:29AM +0000, Paul wrote:
> On Thursday, 20 March, 2014 at 17:27:41 GMT, Derek Martin wrote:
> >On Thu, Mar 20, 2014 at 11:36:29AM +0000, Paul wrote:
> >>Try "set encoding=utf-8" as the first thing in your .vimrc.
> >
> >Paul, this is bad advice; please stop telling people to do this.  It's
> >much more likely to make things worse, than better.
> 
> It is "highly recommended" to do this in such an environment as the OP's:
> 
> http://vimdoc.sourceforge.net/htmldoc/options.html#%27encoding%27
> 
> Perhaps I should stop persistently telling everyone (ie. a guy in a thread 
> one time) that suggestion.

The relevant bit to your comment is this:

  NOTE: For GTK+ 2 it is highly recommended to set 'encoding' to
    "utf-8".  Although care has been taken to allow different values of
    'encoding', "utf-8" is the natural choice for the environment and
    avoids unnecessary conversion overhead.

Yes, exactly.  But also:

   'encoding' 'enc' string (default: "latin1" or value from $LANG)
                                              ^^^^^^^^^^^^^^^^^^^

So... if you set $LANG properly to a UTF-8 encoding, vim will
AUTOMATICALLY set econding CORRECTLY for you based on that.  This is
what you want...  You don't want to manually set it so that if your
environment changes, or you copy your .vimrc to a machine which does
not HAVE UTF-8, then you will break things and (unless you're very
familiar with locale issues, which clearly the OP is not) you will
have a hard time remembering/determining why.

So, in conclusion: DO NOT EVER MANUALLY SET ENCODING VARIABLES, UNLESS
YOU KNOW WHAT YOU'RE DOING. THE ENVIRONMENT WILL DO THIS FOR YOU BASED
ON $LANG, AND THIS IS VIRTUALLY ALWAYS WHAT YOU WANT, unless you're
absolutely positive that it isn't, in which case you won't be posting
messages to mutt-users asking why things are broken.

-- 
Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.

Attachment: pgp792bnKhckg.pgp
Description: PGP signature

Reply via email to