Hi,
I have found that all localized messages from fetchmail(1) is
converted to ASCII when running Redhat Linux 7.0 which uses
glibc 2.1.92.
I intend to propose a patch to the author to solve problem, but
I would first like to hear here if it does it the right way. The
important part of the patch is:
@@ -160,6 +170,19 @@ int main(int argc, char **argv)
#ifdef ENABLE_NLS
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
+ /*
+ * GNU libc 2.2 will convert all translated messages from gettext()
+ * to what it thinks is the current output character set. The default
+ * depends on the LC_CTYPE locale, but we cannot permanently set this
+ * as it would affect all isXXXXX() calls all over the program --
+ * so we have to bind the default charset to the right value instead.
+ */
+ setlocale (LC_CTYPE, "");
+ bind_textdomain_codeset (PACKAGE, nl_langinfo(CODESET));
+ bind_textdomain_codeset ("libc", nl_langinfo(CODESET));
+ setlocale (LC_CTYPE, "C");
+#endif
#endif
I miss a way to bind the codeset for /all/ textdomains which
might be used by any libraries the program will be linked to. Is
this possible?
And one more question: On Redhat 7.0 bind_textdomain_codeset is
only in libc.a but not libc.so, so I have to statically link to
use the function. Is this a specific Redhat bug, or a bug in
glibc 2.1.92?
--
Byrial
http://home.worldonline.dk/~byrial/
-
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/lists/