Marc-Andre Lemburg added the comment:

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.

----------
nosy: +lemburg

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue504219>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to