Message127347
| Author |
loewis |
| Recipients |
Arfrever, ezio.melotti, georg.brandl, lemburg, loewis, ned.deily, pitrou, r.david.murray, vstinner |
| Date |
2011年01月28日.21:22:14 |
| SpamBayes Score |
6.4758754e-12 |
| Marked as misclassified |
No |
| Message-id |
<4D433385.3020704@v.loewis.de> |
| In-reply-to |
<4D42A308.2000406@egenix.com> |
| Content |
>> 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. |
|