GH-133711: Enable UTF-8 mode by default (PEP 686) (#133712)

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Adam Turner 2025-07-15 10:45:41 +01:00 committed by GitHub
parent f320c951c3
commit c89a66feb1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 93 additions and 85 deletions

View file

@ -102,15 +102,14 @@ typedef struct PyPreConfig {
/* Enable UTF-8 mode? (PEP 540)
Disabled by default (equals to 0).
If equal to 1, use the UTF-8 encoding and use "surrogateescape" for the
stdin & stdout error handlers.
Set to 1 by "-X utf8" and "-X utf8=1" command line options.
Set to 1 by PYTHONUTF8=1 environment variable.
Enabled by default (equal to 1; PEP 686), or if Py_UTF8Mode=1,
or if "-X utf8=1" or PYTHONUTF8=1.
Set to 0 by "-X utf8=0" and PYTHONUTF8=0.
If equals to -1, it is set to 1 if the LC_CTYPE locale is "C" or
"POSIX", otherwise it is set to 0. Inherit Py_UTF8Mode value value. */
Set to 0 by "-X utf8=0" or PYTHONUTF8=0.
*/
int utf8_mode;
/* If non-zero, enable the Python Development Mode.