Tuesday, October 5, 2010

Re: How to set utf-8 locally (for a buffer) on loading the file

On Mon, Oct 04, 2010 at 10:22:44PM -0700, esquifit wrote:
> [snip]
>
> NOTE: Changing this option will not change the encoding of the
> existing text in Vim. It may cause non-ASCII text to become invalid.
>
> This sentence is somewhat obscure. If I change 'encoding' after having
> loading a buffer, it effectively causes 'some non-ASCII text to become
> invalid'. What does then the statement mean, that 'this option will
> not change the encoding of the existing text in VIm'?

'encoding' controls how Vim stores the data internally (not when
displaying). If you change it, the stored data is interpreted
differently. I guess for simplicity Vim doesn't recode the stored
data when changing 'encoding' thus causing problems if you change
it (as the data may be invalid or mean something different in the
new encoding).

Hope this helps,
Simon
--
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9

No comments:

Post a Comment