GNOME Bugzilla – Bug 304517
glib/libcharset/localcharset.c/_g_locale_charset_raw: handling LANG environment
Last modified: 2011-02-18 16:14:20 UTC
On some platforms (like AIX 5.2) nl_langinfo(CODESET) always returns "ISO8859-1" without examining environment variables LC_ALL/LC_CTYPE/LANG. If I #define HAVE_LANGINFO_CODESET to 0, function _g_locale_charset_raw will use LC_ALL/LC_CTYPE/LANG variables (lines 272-281), but do not strip "charset" part from the value, like in the case of OS/2 (lines 314-338) Eg: hu_HU.ISO8859-2 ==> ISO8859-2 Perhaps this part of code could be copied after line 281 to solve this. Other information:
We will need a configure check to test if nl_langinfo actually works to fix this.
Perhaps the method used by GNU-gettext can be useable: before ./configure, user can set "am_cv_langinfo_codeset" variable to "no" which prevents calling of nl_langinfo(CODESET) in /gettext-v.v.v/gettext-tools/lib/localcharset.c
You can almost certainly do the exact same thing for GLib. (Glib is using the *same* code as gettext.) But it's not a solution, it's just a hackaround. A solution would mean that GLib works correctly out of the box without manual intervention at the configure step.
2006-12-27 Matthias Clasen <mclasen@redhat.com> * configure.in: Use AC_CACHE_CHECK for the nl_langinfo check. (#304517, Lőrinczy Zsigmond)