➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 vstinner
收信人 ezio.melotti, vstinner
日期 2017-01-11.11:27:21
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1484134042.51.0.347511837763.issue29240@psf.upfronthosting.co.za>
In-reply-to
内容
pep540.patch: first draft

Changes:

* Add sys.flags.utf8mode
* Add -X utf8 command line option
* Add PYTHONUTF8 environment variable
* sys.stdin, sys.stdout and sys.stderr encoding and errors are modified in UTF-8 mode
* open() default encoding and errors is modified in the UTF-8 mode
* Add Lib/test/test_utf8mode.py
* Skip a few tests relying on the locale encoding if the UTF-8 mode is enabled
* Document changes

Allowed options:

* Disable UTF-8 mode: -X utf8=0 or PYTHONUTF8=0
* Enable UTF-8 mode: -X utf8=1 or PYTHONUTF8=1
* Enable UTf-8 Strict mode: -X utf8=strict or PYTHONUTF8=strict
* Other -X utf8 and PYTHONUTF8 values cause a fatal error

Prioririties (highest to lowest):

* open() encoding and errors arguments
* PYTHONIOENCODING
* UTF-8 mode
* os.device_encoding()
* locale encoding

TODO:

* re-encode sys.argv from the local encoding to UTF-8 in Py_Main() when the UTF-8 mode is enabled
* support strict mode in Py_DecodeLocale() and Py_EncodeLocale()
历史
日期 用户 动作 参数
2017-01-11 11:27:24vstinner修改recipients: + vstinner, ezio.melotti
2017-01-11 11:27:22vstinner修改messageid: <1484134042.51.0.347511837763.issue29240@psf.upfronthosting.co.za>
2017-01-11 11:27:22vstinner链接issue29240 messages
2017-01-11 11:27:22vstinner创建