PEP 686 – Make UTF-8 mode default

# · 🔥 238 · 💬 115 · 12 days ago · peps.python.org · GalaxySnail · 📷
The default encoding of Python source files is UTF-8. Changing the default encoding to UTF-8 makes it easier for Python to interoperate with them. Python will enable UTF-8 mode by default from Python 3.15. Getpreferredencoding(False), we need an API to get locale encoding regardless of UTF-8 mode. TextIOWrapper should use locale encoding when the option is specified, regardless of default text encoding. It is because we didn't expect making UTF-8 mode default when Python changes its default text encoding. TextIOWrapper should use locale encoding when encoding="Locale" is passed even in UTF-8 mode.
PEP 686 – Make UTF-8 mode default



Send Feedback | WebAssembly Version (beta)