Bugzilla – Bug 102615
ISOLanguage.cc does not accept LANG=POSIX
Last modified: 2005-08-11 08:23:20 UTC
when started with LC_CTYPE=en_US.UTF-8 LANG=POSIX yast does the following fallback: 2005-08-08 18:08:58 <1> g198(13937) [liby2] genericfrontend.cc(main):482 YAST_IS_RUNNING is yes 2005-08-08 18:08:58 <1> g198(13937) [Y2PM] Y2PM.locale.cc(LocaleSettings):72 $LANG='POSIX' 2005-08-08 18:08:58 <2> g198(13937) [liby2util] ISOLanguage.cc(_assert):74 Malformed ISOLanguage code 'POSIX' (size != 2) 2005-08-08 18:08:58 <2> g198(13937) [liby2util] ISOLanguage.cc(_assert):79 Malformed ISOLanguage code 'POSIX' (not lower case) 2005-08-08 18:08:58 <1> g198(13937) [liby2util] ISOLanguage.cc(_assert):92 Remember language code 'POSIX': Unknown language 'POSIX' 2005-08-08 18:08:58 <1> g198(13937) [Y2PM] Y2PM.locale.cc(LocaleSettings):78 Preferred locale: 'POSIX' 2005-08-08 18:08:58 <1> g198(13937) [Y2PM] Y2PM.locale.cc(LocaleSettings):79 Fallback locale: 'en' LANG should rather fallback to LC_CTYPE, but POSIX should have been accepted in the first place.
Well, 'POSIX' is no language. ISOLanguage stores language codes we use for delivering translated metadata (label, descriptions...) to the UI. So accepting POSIX isn't helpfull here. Usg. the application explicitly sets the language. The environment is evaluated just in case the application misses to set it. But you're right, looking at LANG is not sufficient, but the correct sequence would IMO be: LC_ALL -> LC_CTYPE -> LANG as last resort.
Hmmm ... IMHO 'POSIX' or 'C' is not a language but a well defined codeset. Btw: Whx not using the nl_langinfo interface of the glibc to get the current CODESET. With #include <langinfo.h> and char *codeset = nl_langinfo(CODESET); you get the current used codeset like "UTF-8", "ISO-8859-1", or "ANSI_X3.4-1968" No need to ask the several environment variables or use setlocale to the the information.
Fixed in yast2-packagemanager-2.12.13. (evaluates LC_ALL -> LC_CTYPE -> LANG; ignore 'POSIX' or 'C' as we need a real language; fallback to 'en' if nothing useable was found)