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.

Author lemburg
Recipients BreamoreBoy, georg.brandl, jlgijsbers, lemburg, loewis, meonkeys, mhammond, syvere, tim.peters
Date 2013-03-23.12:33:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1364042017.48.0.793691881615.issue504219@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-03-23 12:33:37lemburgsetrecipients: + lemburg, tim.peters, loewis, mhammond, georg.brandl, jlgijsbers, syvere, meonkeys, BreamoreBoy
2013-03-23 12:33:37lemburgsetmessageid: <1364042017.48.0.793691881615.issue504219@psf.upfronthosting.co.za>
2013-03-23 12:33:37lemburglinkissue504219 messages
2013-03-23 12:33:37lemburgcreate