Bug#379107: vim: Should automaticly get the terminal encoding from
the enviroment.
Kurt Roeckx
kurt at roeckx.be
Fri Jul 21 12:25:23 UTC 2006
On Fri, Jul 21, 2006 at 01:39:53PM +0200, Kurt Roeckx wrote:
> Hi,
>
> The manual says:
> 'termencoding' 'tenc' string (default ""; with GTK+ 2 GUI: "utf-8"; with
> Macintosh GUI: "macroman")
>
> Why isn't it using LC_CTYPE to get this?
>
> What I currently have is:
> $ locale charmap
> ISO-8859-1
>
> If I had a UTF-8 terminal, it would have:
> $ LC_CTYPE=en_US.UTF-8 locale charmap
> UTF-8
>
> Why isn't it using nl_langinfo(CODESET) to set the default?
> Taking a very quick look at the source, it seems to be using it,
> but I'm not sure what it's doing with it.
I took a closer look at it, and also saw this:
'encoding' 'enc' string (default: "latin1" or value from $LANG)
So, I think it's using nl_langinfo(CODESET) for encoding and not
for termencoding. And this doesn't make sense to me.
I was about to file a seperate bug have encoding default to
utf-8, or atleast some unicode variant. The encoding only seems
to be used for storing things internally.
Changing the default encoding to a unicode equivalent would
change this:
'fileencodings' 'fencs' string (default: "ucs-bom",
"ucs-bom,utf-8,default,latin1" when
'encoding' is set to a Unicode value)
Which will then correctly guess my fileenconding.
What I currently need to do is:
set encoding=utf-8
set termencoding=latin1
To have things work "properly".
What I would like to see is:
- The default termencoding is based on LC_CTYPE
- The internal encoding is unicode (or wchar_t) based.
I'm trying to come up with arguments why having the encoding
default to for instance utf-8 isn't a good thing. And I can't
come up with something. The only thing I see that it has an
effect for is that it now might properly guess the fileencoding
when opening a file.
I can't see a reason at all while termencoding can't be based on
the LC_CTYPE.
Kurt
More information about the pkg-vim-maintainers
mailing list