[issue26024] Non-ascii Windows locale names

2019-08-23 Thread Vidar Fauske
Vidar Fauske added the comment: Thanks. Note that the failing with ` locale.setlocale(locale.LC_ALL, locale.getdefaultlocale())` I mentioned above is a different problem, that is tracked in a much older issue: https://bugs.python.org/issue10466 -- ___

[issue26024] Non-ascii Windows locale names

2019-08-23 Thread STINNER Victor
STINNER Victor added the comment: It seems like this bug has been fixed in Python 3.5, so I close the issue. What changed in Python 3.5 is that the *result* of locale.setlocale() is now the english name of the locale and so is compatible with the ASCII encoding. Vidar Fauske: > The Norwegian

[issue26024] Non-ascii Windows locale names

2019-02-11 Thread Steve Dower
Steve Dower added the comment: We should switch to _wsetlocale, or else come up with a more sensible mapping that makes sense between platforms (like we have for encodings already). I suspect the latter requires proper design and discussion, so it's worth doing the first part immediately. -

[issue26024] Non-ascii Windows locale names

2019-02-11 Thread Vidar Fauske
Vidar Fauske added the comment: This issue can still be triggered for Python 3.7 by the following line (running on a Windows machine with a Norwegian locale as default): locale.setlocale(locale.LC_ALL, locale.getdefaultlocale()) -- versions: +Python 3.7 _

[issue26024] Non-ascii Windows locale names

2016-01-09 Thread Eryk Sun
Eryk Sun added the comment: The issue isn't quite the same for 3.5+. The new CRT uses Windows Vista locale APIs. In this case it uses LOCALE_SENGLISHLANGUAGENAME instead of the old LOCALE_SENGLANGUAGE. This maps "Norwegian" to simply "Norwegian" instead of "Norwegian Bokmål": >>> locale.s

[issue26024] Non-ascii Windows locale names

2016-01-08 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- versions: +Python 3.5, Python 3.6 -Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue26024] Non-ascii Windows locale names

2016-01-06 Thread Eryk Sun
Eryk Sun added the comment: Yes, it's ANSI. I should have said "system locale" instead of "current locale". To find the requested locale, the CRT function __get_qualified_locale calls EnumSystemLocalesA. The passed callback calls GetLocaleInfoA for each enumerated locale to get the country (SE

[issue26024] Non-ascii Windows locale names

2016-01-06 Thread STINNER Victor
STINNER Victor added the comment: > PyLocale_setlocale in Modules/_localemodule.c is incorrectly passing the > locale as a UTF-8 string ("z") instead of using the codepage of the current > locale. Do you mean that the function must encode the locale name to the *ANSI codepage*? --

[issue26024] Non-ascii Windows locale names

2016-01-06 Thread Eryk Sun
Eryk Sun added the comment: PyLocale_setlocale in Modules/_localemodule.c is incorrectly passing the locale as a UTF-8 string ("z") instead of using the codepage of the current locale. As you can see below "å" is passed as the UTF-8 string "\xc3\xa5": >>> locale._setlocale(locale.LC_TIME,

[issue26024] Non-ascii Windows locale names

2016-01-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This can be related to issue25812. Python supposes that locale settings in all categories use the same encoding (set by LC_CTYPE). Try first to set LC_CTYPE to ASCII-named locale with the 1252 codepage. -- nosy: +serhiy.storchaka ___

[issue26024] Non-ascii Windows locale names

2016-01-06 Thread Vidar Fauske
New submission from Vidar Fauske: The Norwegian locale on Windows has the honor of having the only locale name with a non-ASCII character ('Norwegian Bokmål_Norway', see e.g. https://wiki.postgresql.org/wiki/Changes_To_Norwegian_Locale). It does not seem like python 3 is able to handle this pr