Hi Bram :)

 * Bram Moolenaar <[EMAIL PROTECTED]> dixit:
> DervishD wrote:
> > > Keep in mind that when you change 'encoding' in a running Vim then all
> > > text in loaded buffers, registers, variables, etc. will become
> > > invalid. It's better to only set 'encoding' when starting up and then
> > > leave it alone.
> > 
> >     Yes, I supposed that something like that would happen, but if I
> > don't set 'encoding' I'm not able to see the characters correctly. I
> > mean, they will be correctly written to the file in utf8 but I won't be
> > able to see them on the screen. I know that this is risky, but the
> > alternative will consider all my US-ASCII files (and any newly created
> > one) as utf8 and I don't want that right now. For me is easier to do the
> > above and take the risk because I seldom edit utf8 files. If I run into
> > trouble, I'll probably use some "BufReadPost" autocommand to properly
> > set both 'encoding' and 'fileencoding'.
> 
> Did you try setting 'termencoding'?

    My terminal is latin1 and only understands latin1, unfortunately, so
changing "termencoding" to any different of "latin1" just causes more
harm. BTW, I use vim always on the virtual console, text mode.

> "utf-8" is a superset of "latin1", thus using "utf-8" for 'encoding'
> should nearly always work.

    Except that then I have to encode my 'showbreak' option as utf8 and
not latin1 :( I prefer to have it encoded as latin1 (as the rest of my
files), until I switch to utf8.

    So far, the only combination that does what I want is setting 'tenc'
to latin1 (which is the correct one for my virtual terminal under
Linux), and setting 'enc' by hand, leaving 'fenc' empty so it is in sync
with 'encoding'. Of course, this is dangerous because changing
'encoding' is never a good idea, and I shouldn't been changing it, buf
if I only change 'fenc', I still see 'á' instead of 'á'. If I change
'enc', I see 'á', correctly. What I don't understand is that if I set
'fencs' and let 'fenc' take the value from it, the translation is done
correctly because vim converts the characters. Once the file is loaded,
this doesn't happen and setting 'enc' by hand seems the only choice. Am
I doing anything wrong?

    Thanks again for your help :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!

Reply via email to