This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 lemburg
收信人 BreamoreBoy, georg.brandl, jlgijsbers, lemburg, loewis, meonkeys, mhammond, syvere, tim.peters
日期 2013-03-23.12:33:37
SpamBayes Score -1.0
Marked as misclassified
Message-id <1364042017.48.0.793691881615.issue504219@psf.upfronthosting.co.za>
In-reply-to
内容
Adding support for locales that are not recognized is easy and the locale parser could also learn about formats that it doesn't yet understand, so patches are welcome.

The main problem here is that setlocale() only understands a very limited set of locale names.

Please note that locale.getdefaultlocale() is not the same as locale.getpreferredencoding():

* getdefaultlocale() aims to find the default locale settings for a program which has not yet called setlocale(LC_ALL, "").

* getpreferredencoding() tries to make an educated guess at the encoding the user has setup for his/her environment. It works well on Windows, but on Unix, requires a call to setlocale() to implement the environment variable parsing, which is exactly what getdefaultlocale() tries to avoid.
setlocale() is not thread-safe, so the approach taken by getpreferredencoding() can have unwanted side-effects.
历史
日期 用户 动作 参数
2013-03-23 12:33:37lemburg修改recipients: + lemburg, tim.peters, loewis, mhammond, georg.brandl, jlgijsbers, syvere, meonkeys, BreamoreBoy
2013-03-23 12:33:37lemburg修改messageid: <1364042017.48.0.793691881615.issue504219@psf.upfronthosting.co.za>
2013-03-23 12:33:37lemburg链接issue504219 messages
2013-03-23 12:33:37lemburg创建