Roger Leigh wrote:
> I created a C.po file, and this installed as schroot.mo under
> /usr/share/locale.  This po file simply converts the UTF-8 chars to
> the nearest ASCII equivalent e.g. © -> (C).  However, when running
> under the C or POSIX locales, bindtextdomain() never even checks for
> the existence of a message catalogue (checked with strace).
>
> Is this correct?  If so, is this a gettext or libc bug?

gettext() does no conversion at all when running in the C or POSIX locale.
This is because the POSIX standard specifies the precise output of many
commands in the C locale, and no localization is allowed in this case.

You can get the desired behaviour by using an English locale (such as
en_US.US-ASCII - note: you have to create this locale first, using 'localedef').
You build the message catalog for this locale using the 'msgen' command.
It can contain UTF-8 in both the msgid and the msgstr; the gettext() library
function will take care of converting many common UTF-8 characters to ASCII
when the locale's encoding is ASCII.

Bruno


--
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/linux-utf8/

Reply via email to