DervishD wrote:

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

If your terminal always is in "latin1" then you should indeed set
'termencoding' to "latin1".

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

Yeah, there are small things like this.  You might want to put this in
your .vimrc:
        scriptencoding latin1

>     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 'á'.

Of course, changing 'fenc' doesn't have any immediate effect.  It only
changes the encoding that Vim will write the file with.

> If I change 'enc', I see 'á', correctly.

You should do ":edit ++enc=utf-8 filename" or include "utf-8" in
'fileencodings' before editing the file.  Then it will work no matter
what 'encoding' is set to.

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

Yes.  'fenc' is set by Vim when it reads the file.  Setting it to
another value doesn't cause the file to be reread or conversion to be
done.

-- 
What a wonderfully exciting cough!  Do you mind if I join you?
                -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

Reply via email to