Message127347
>> That would be highly non-portable, and repeat the mistakes of
>> getdefaultlocale.
>
> You say that often, but I don't really know why. It's certainly portable
> between various Unix platforms, perhaps not Windows, but then i18n
> on Windows is a different story altogether.
No, it's absolutely not portable across Unix platforms. Looking at
LANG or LC_ALL does *not* allow you to infer the region name, or
the locale's character set. For example, using glibc, in some
installations, /etc/locale.alias is considered to map a value of LANG
to the final locale name. As an option, glibc also considers a
LOCALE_ALIAS_PATH that may point to a (colon-separated) path of
files to search for locale aliases.
Other systems may use other databases to map a locale name to locale
properties.
Unless you know exactly what version of C library is running on
a system, parsing environment variables yourself is doomed to fail. |
|
Date |
User |
Action |
Args |
2011-01-28 21:22:15 | loewis | set | recipients:
+ loewis, lemburg, georg.brandl, pitrou, vstinner, ned.deily, ezio.melotti, Arfrever, r.david.murray |
2011-01-28 21:22:14 | loewis | link | issue6203 messages |
2011-01-28 21:22:14 | loewis | create | |
|