Message415851
> * sys.getfilesystemencoding(): Python filesystem encoding, return "UTF-8" if the Python UTF-8 Mode is enabled
Yes, althoguh PYTHONLEGACYWINDOWSFSENCODING takes priority.
> * locale.getencoding(): Get the locale encoding, LC_CTYPE locale encoding or the Windows ANSI code page, *read at Python startup*. Ignore the Python UTF-8 Mode.
I proposed `locale.get_encoding()` in the PEP 686. I will remove underscore if you don't like it.
> * locale.getencoding(current=True): Get the *current* locale encoding. The difference with locale.getencoding() is that on Unix, it gets the LC_CTYPE locale encoding at each call.
Hmm, I don't add it to the PEP 686 because it is not relating to UTF-8 mode nor EncodingWarning.
Since `locale.getencoding()` returns locale encoding on startup, how about this idea?
* sys.getlocaleencoding() -- Get the locale encoding read at Python startup.
* locale.getencoding() -- Get the current locale encoding.
Note that we have `sys.getdefaultencoding()` and `sys.getfilesystemencoding()`. `sys.getlocaleencoding()` looks consistent with them. |
|
Date |
User |
Action |
Args |
2022-03-23 02:48:59 | methane | set | recipients:
+ methane, lemburg, vstinner, ezio.melotti |
2022-03-23 02:48:59 | methane | set | messageid: <1648003739.33.0.597083503759.issue47000@roundup.psfhosted.org> |
2022-03-23 02:48:59 | methane | link | issue47000 messages |
2022-03-23 02:48:59 | methane | create | |
|