On Mon, Oct 02, 2000 at 15:32:20 +0200, Bruno Haible wrote:
> Byrial Jensen writes:
>
> > + setlocale (LC_CTYPE, "");
> > + bind_textdomain_codeset (PACKAGE, nl_langinfo(CODESET));
> > + bind_textdomain_codeset ("libc", nl_langinfo(CODESET));
> > + setlocale (LC_CTYPE, "C");
> This will nearly work. But not completely, because glibc's gettext function
> needs the LC_CTYPE locale for the codeset _and_ for the transliteration.
> You are only setting the codeset.
>
> I would therefore favour the opposite approach: Simply use
>
> setlocale (LC_CTYPE, "");
But this will not give correct translitterations either!
LC_CTYPE determines the receiving charset and the translitteration
rules for converting from that charset to another charset.
You need translitteration rules for the from-charset, not for the
to-charset. You will only need to translitterate if you have a
character in the from-charset which doesn't exist in the to-charset.
And when it doesn't exist in the to-charset, the to-charset cannot
be expected to have translitteration rules for that character. So
setting LC_CTYPE doesn't help.
The only the way to get correct translitteration is, as I see it, to
use the translitteration rules defined in that LC_CTYPE locale which
corresponds to the used LC_MESSAGES locale. And as the used
LC_MESSAGES locale can vary for every message, it is impossible for
the application to handle this by setting LC_CTYPE.
--
Byrial
http://home.worldonline.dk/~byrial/
-
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/lists/