List of locale values for locale.setlocale() under Windows

python at bdurham.com python at bdurham.com
Tue Feb 17 15:00:19 EST 2009


I'm experimenting with the locale module and have been unable to
get the documentation examples to run on Windows XP. (The
examples run fine on Linux).
In particular, none of the locale.setlocale( category, locale )'s
sample locale parameter values are considered valid. Example:
>>> locale.setlocale( locale.LC_ALL, 'fr_FR' )
Traceback (most recent call last):
  File "<pyshell#160>", line 1, in <module>
    locale.setlocale( locale.LC_ALL, 'fr_FR' )
  File "c:\python26\lib\locale.py", line 494, in setlocale
    return _setlocale(category, locale)
Error: unsupported locale setting
The documentation states that these values "may vary across
platforms".
Here's what I get for my current locale:
>>> locale.getlocale()
('English_United States', '1252')
Any suggestions on where I can find the official list of locale
codes for Windows XP (or better yet, all versions of Windows XP
or later)?
Thank you,
Malcolm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090217/0ca186b6/attachment.html>


More information about the Python-list mailing list