bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wrong codepage used by gettext


From: Bruno Haible
Subject: Re: wrong codepage used by gettext
Date: Wed, 28 Apr 2004 14:48:55 +0200
User-agent: KMail/1.5

vr wrote:
> the workaround you suggested works, but it breaks certain programs.
>
> You see, in Vim, using cp1251 messages: we get all the messages just fine,
> the only problem is with output that goes directly to console window, such as
> doing vim --version or setting console window title. After setting 
> OUTPUT_CHARSET
> to CP866 it gets just the other way around: window title and vim --help is
> fine, but l18n of messages inside Vim gets broken. Can there be a better 
> solution?

We had a similar problem on HP-UX 10 years ago: the console window was using
HP-ROMAN8 but all other X11 applications used ISO-8859-1. There was no
solution (except to dump the HP machine and buy a Linux PC).

For vim, I can see two solutions:

a) vim knows for what purpose it will use each string, and sets the
environment variable OUTPUT_CHARSET before calling gettext(). (There is
a Woe32 specific caveat here; see
http://www.haible.de/bruno/gettext-FAQ.html#windows_setenv)

Or equivalently, vim distributes each .mo file in two copies, say,
vim_gui.mo and vim_console.mo, uses dcgettext to access them, and uses
bind_textdomain_codeset("vim_console", "CP866").

b) Let a low-level I/O layer take care of it. GNU clisp does it this way;
look at the ANSI2OEM_table transformation in the function write_helper in
http://cvs.sourceforge.net/viewcvs.py/clisp/clisp/src/win32aux.d?rev=1.36&view=text

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]