DervishD wrote:
Hi Bram :)
* Bram Moolenaar <[EMAIL PROTECTED]> dixit:
"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
It's already there but that doesn't fix the problem with
'showbreak'.
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.
But then my US-ASCII files (and new files) will be considered utf-8,
and I don't want that. Or do you mean that if I set (e.g.)
'fencs=ucs-bom,latin1,utf8' things will work even if utf8 is never tried
because latin1 always succeeds?
In ":set fencs=ucs-bom,latin1,utf8", UTF-8 is indeed never tried because
Latin1 always succeeds. And that means *never*. IOW, that setting is logically
equivalent to just ":set fencs=ucs-bom,latin1". There is _nothing_ that Vim
will do in one case and not in the other.
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.
OK, now I understand, thanks :)))) Any way of forcing a conversion?
Again, thanks a lot :)
Raúl Núñez de Arenas Coronado
Best regards,
Tony.