[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gettext charset-conversion does not work
From: |
Andreas Metzler |
Subject: |
gettext charset-conversion does not work |
Date: |
Sun, 3 Mar 2002 16:00:56 +0100 |
User-agent: |
Mutt/1.3.27i |
Hello,
This is probably a very simple error but I'm unable to get gettext's
automatic charset-conversion to work.
-------------------------------
#include <locale.h>
#define LOCALEDIR "/tmp/mylocales"
#include <libintl.h>
#define N_(Str) Str
#define _(Text) gettext (Text)
#define PACKAGE "gettexttest"
#include <langinfo.h>
#include <stdio.h>
int main()
{
typedef const char constext;
constext txt_blahfasel[] = N_("Oesterreich");
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
printf ("%s\n", _(txt_blahfasel));
printf ("charset is %s\n", nl_langinfo(CODESET));
exit(0);
}
-------------------------------
In the po-file (written in latin1, the charset for de_DE) for de_DE
Oesterreich is translated to "Österreich", and this works well with
the de_DE-locale, but not with de_DE.UTF-8 in an unicode-xterm,
the program still prints char 214 (Hex D6) (Ö in latin1,
non-displayable char in UTF-8).
I think my system is ok, afaict mutt is using gettext's automatic
charset conversion successfully, de_DE and de_DE.UTF-8 are supported
locales on my system.
System-info:
Debian GNU/Linux woody/testing
gettext 0.10.40-3, libc6 2.2.5-3, mutt 1.3.27-2.
Please Cc me on follow-ups.
tia, cu andreas
- gettext charset-conversion does not work,
Andreas Metzler <=