[Python-Dev] cpython: Issue #16129: Add Py_SetStandardStreamEncoding
(original) (raw)
Antoine Pitrou solipsis at pitrou.net
Thu Oct 17 17:36:40 CEST 2013
- Previous message: [Python-Dev] Bug tracker and docs at python
- Next message: [Python-Dev] cpython: Issue #16129: Add `Py_SetStandardStreamEncoding`
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, 17 Oct 2013 15:22:03 +0200 (CEST) nick.coghlan <python-checkins at python.org> wrote:
+.. c:function:: int PySetStandardStreamEncoding(char *encoding, char *errors) + + .. index:: + single: PyInitialize() + single: main() + triple: stdin; stdout; sdterr + + This function should be called before :c:func:
PyInitialize
. It + specifies which encoding and error handling to use with standard io, + with the same meanings as in :func:str.encode
. + + It overrides :envvar:PYTHONIOENCODING
values, and allows embedding code + to control io encoding when the environment variable does not work. + +encoding
and/orerrors
may be NULL to use + :envvar:PYTHONIOENCODING
and/or default values (depending on other + settings). + + Note that :data:sys.stderr
always uses the "backslashreplace" error + handler, regardless of this (or any other) setting. + + If :c:func:PyFinalize
is called, this function will need to be called + again in order to affect subsequent calls to :c:func:PyInitialize
. + + Returns 0 if successful. + +
Needs a versionadded tag.
Regards
Antoine.
- Previous message: [Python-Dev] Bug tracker and docs at python
- Next message: [Python-Dev] cpython: Issue #16129: Add `Py_SetStandardStreamEncoding`
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]