Message389089
> I created this issue while reviewing the implementation of the PEP 597: PR 19481.
What I want is same to `locale.getpreferredencoding(False)` but ignores UTF-8 mode.
Background: PEP 597 adds new `encoding="locale"`option to open() and TextIOWrapper(). It is same to `encoding=None` for now, but it means using "locale encoding" explicitly.
But this is wrong in UTF-8 mode.
In UTF-8 mode, it's fine to `open(filename)` uses UTF-8. But I want to use "locale encoding" for `open(filename, encoding="locale")` because "locale" encoding is specified.
I don't want to add new meaning here. It should be same to `locale.getpreferredencoding(False)` without UTF-8 mode. So I need "cp%d" % GetACP() on Windows, not CRT locale encoding.
I don't care its name. both of sys.locale_encoding() and locale.get_encoding() are OK. |
|
Date |
User |
Action |
Args |
2021-03-19 13:57:29 | methane | set | recipients:
+ methane, lemburg, vstinner, eryksun |
2021-03-19 13:57:29 | methane | set | messageid: <1616162249.48.0.772700997915.issue43552@roundup.psfhosted.org> |
2021-03-19 13:57:29 | methane | link | issue43552 messages |
2021-03-19 13:57:29 | methane | create | |
|