6 msgnvidia-driver crashes X
5 msglogrotate

vim encoding
\ Mick (13 Aug 2007)
. \ Steffen Loos (13 Aug 2007)
. \ Benno Schulenberg (13 Aug 2007)
. . \ Mick (13 Aug 2007)
. . . \ Benno Schulenberg (13 Aug 2007)
. . . . \ Mick (14 Aug 2007)
. . . . . \ Benno Schulenberg (14 Aug 2007)
. . . \ Michal 'vorner' Vaner (14 Aug 2007)
. . . . \ Mick (14 Aug 2007)
. . . . \ Willie Wong (15 Aug 2007)

4 msg[OT] Help with Perl Datetime + Epoch
4 msgMust I re-emerge gcc entirely?
18 msgCXXABI error after gcc upgrade
4 msgACPI problem on Compaq
2 msgStrange behavior when booting with softlevel=si...
1 msgRunlevels
4 msgMutt depends on Lynx ?
41 msgchecking for XML::Parser... configure: error: X...
2 msgOT-hacking vim syntax highlighting
2 msgAyuda
7 msgwhere does ufed put flags?
4 msg/etc/portage/package.cflags
3 msgReplytolist plug-in for thunderbird not working
4 msgDell Inspiron 530 compatability questions befor...
10 msgamd64 & 4G memory
14 msgOT :video cameras and gentoo
12 msgNew CPU, what needs to be done?
Subject:Re: vim encoding
Group:Gentoo-user
From:Willie Wong
Date:15 Aug 2007


 
On Tue, Aug 14, 2007 at 08:38:38AM +0200, Penguin Lover Michal 'vorner' Vaner squawked:
> Hello
>
> On Mon, Aug 13, 2007 at 10:42:17PM +0100, Mick wrote:
> > Hmm, I just checked a utf-8 file after I edited it and it says:
> >
> > :set encoding
> > encoding=latin1
>
> I would guess your UTF-8 file has no accents, or other characters. In
> other words, it can be considered pure ASCII, which means Vim can safely
> assume it is latin1 encoded text - there is no difference no matter
> which reasonable encoding it chooses. (The encoding is not saved in the
> file, it is guessed from what is saved there)

Uh, that's not exactly correct.

encoding is the value assumed from LANG that the buffer uses: it is
the encoding of the terminal you are using, and how you enter text and
how the buffer should be displayed on the screen.

fileencoding (:help fenc) is what determines how the files should be
saved to disk. It is automatically guessed by vim based on the file
in question and the variable fileencodings.

Only when vim cannot guess what encoding the file originally was (in
which case fenc is the empty string), or when you start editing a new
file without specifying fenc, will vim actually convert and save the
file using the encoding specified in the enc variable. Given that the
default vim install on gentoo has "utf8" among the fileencodings
options, vim should correctly detect a utf8 file as such, and even
though you are editing it in a latin1 environment, convert it back to
utf8 on save.

W
--
Statistics are like a Bikini:
showing interesting details but hiding the important stuff.
Sortir en Pantoufles: up 250 days, 19:22
--
gentoo-user mailing list



© 2004-2008 readlist.com