-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] IO > Text Encoding info outdated #90301
Comments
On this page: https://docs.python.org/3/library/io.html#text-encoding it says "there is no concrete plan as of yet, Python may change the default text file encoding to UTF-8 in the future". On this page https://docs.python.org/3/library/os.html#utf8-mode is says that from 3.7 onwards UTF-8 will be selected by default. Does that mean that the text in the first section is now outdated, as it was addressed by PEP-540? I'm a newbie, so apologies if I'm missing something obvious or filing this in the wrong spot. |
UTF-8 mode is not enabled by default. So locale encoding is still the default encoding. |
The rare circumstance in which UTF-8 mode gets enabled automatically is described in the following paragraph [1]:
Note that UTF-8 mode is never enabled automatically in Windows. In contrast to POSIX, the locale encoding in Windows is unrelated to the current LC_CTYPE locale. Instead, the locale encoding gets set to the process code page, which is based on the system locale by default and never changes while a process is running. The system locale may be incompatible with the current LC_CTYPE locale, Windows user locale, and preferred UI language (e.g. for text resources such as error messages), so try to explicitly use UTF-8 for text files whenever possible. |
Is there anything to change on the
|
PEP 686 has been accepted. It is better to update 3.11 and 3.12 document about PEP 686. |
Doc: Add references to PEP 686. (cherry picked from commit 87679a6) Co-authored-by: Inada Naoki <songofacandy@gmail.com>
SGTM. Thank you. |
Doc: Add references to PEP 686.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: