Eryk Sun <eryk...@gmail.com> added the comment:

> decoding the output of strftime("%Z") with PyUnicode_DecodeLocaleAndSize()
> works again since both agree on using the process active code page

At least it works as much as it ever did. It depends on the process active code 
page being compatible with the preferred UI language of the current process or 
thread. For example if the UI language is Japanese ('ja-JP') for the current 
user, but the process active code page is Latin 1252 (based on the system 
locale), then the result will be garbage. In that case, given the time-zone 
name is in Japanese, both LC_TIME and LC_CTYPE have to be changed to "ja-JP" in 
order to correctly encode (as tzname in ucrt), decode-encode (for strftime in 
ucrt) and finally decode again via PyUnicode_DecodeLocaleAndSize(). If Python 
switched back to using wcsftime() in Windows 10 2004+, then the current locale 
encoding would no longer be a problem for any UI language.

----------

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

Reply via email to