Message364114
| Author |
vstinner |
| Recipients |
abarry, eryksun, ezio.melotti, paul.moore, python-dev, serhiy.storchaka, steve.dower, tim.golden, vstinner, williamdias, zach.ware, Владимир Мартьянов |
| Date |
2020年03月13日.17:31:04 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1584120664.43.0.733522038798.issue26227@roundup.psfhosted.org> |
| In-reply-to |
| Content |
sock_decode_hostname() of socketmodule.c currently uses PyUnicode_DecodeFSDefault() on Windows. PyUnicode_DecodeFSDefault() uses UTF-8 by default (PEP 529).
I understand that the ANSI code page should be used instead of UTF-8.
Would it work to use PyUnicode_DecodeLocale(name, "surrogatepass")? It's implemented with mbstowcs(), but I don't recall which encoding it uses on Windows.
Or can we use PyUnicode_DecodeMBCS(name, strlen(name), "surrogatepass")?
--
I understand that setting PYTHONLEGACYWINDOWSFSENCODING environment variable to 1 should work around the issue. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2020年03月13日 17:31:04 | vstinner | set | recipients:
+ vstinner, paul.moore, tim.golden, ezio.melotti, python-dev, zach.ware, serhiy.storchaka, eryksun, steve.dower, abarry, williamdias, Владимир Мартьянов |
| 2020年03月13日 17:31:04 | vstinner | set | messageid: <1584120664.43.0.733522038798.issue26227@roundup.psfhosted.org> |
| 2020年03月13日 17:31:04 | vstinner | link | issue26227 messages |
| 2020年03月13日 17:31:04 | vstinner | create |
|