Message415768
> But some user want to use UTF-8 mode to change default encoding in their Python environments without waiting Python default encoding changed.
IMO it's a different use case and it should be a different thing. Changing encoding="locale" today is too late, since it's already shipped in Python 3.10 (PEP 597).
I proposed the "current locale" name to distinguish it from the existing "locale":
* "current locale": LC_CTYPE locale encoding or ANSI code page
* "locale": "UTF-8" in UTF-8 Mode, or the current locale
The unclear part to me is if "current locale" must change if the LC_CTYPE locale is changed, or if it should be read once at startup and then never change.
There *are* use case to really read the *current* LC_CTYPE locale encoding. There is already C API for that:
* PyUnicode_EncodeLocale()
* PyUnicode_DecodeLocale(), PyUnicode_DecodeLocaleAndSize()
See also the "current_locale" parameter of the private API _Py_EncodeLocaleEx() and _Py_DecodeLocaleEx(). |
|
Date |
User |
Action |
Args |
2022-03-22 13:18:22 | vstinner | set | recipients:
+ vstinner, lemburg, ezio.melotti, methane |
2022-03-22 13:18:22 | vstinner | set | messageid: <1647955102.32.0.512284263183.issue47000@roundup.psfhosted.org> |
2022-03-22 13:18:22 | vstinner | link | issue47000 messages |
2022-03-22 13:18:22 | vstinner | create | |
|