From: Malcolm Smith Date: Sat, 3 May 2025 01:20:10 +0000 (+0100) Subject: gh-91156: Document how TextIOWrapper interacts with UTF-8 mode (GH-132885) X-Git-Tag: v3.14.0b1~106 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=245cd6c53278006fa34fd7799d32f0884eb7e75d;p=thirdparty%2FPython%2Fcpython.git gh-91156: Document how TextIOWrapper interacts with UTF-8 mode (GH-132885) Document how TextIOWrapper interacts with UTF-8 mode --- diff --git a/Doc/library/io.rst b/Doc/library/io.rst index fcd7afea3544..3aa2f35f05eb 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -965,7 +965,8 @@ Text I/O :class:`TextIOBase`. *encoding* gives the name of the encoding that the stream will be decoded or - encoded with. It defaults to :func:`locale.getencoding`. + encoded with. In :ref:`UTF-8 Mode `, this defaults to UTF-8. + Otherwise, it defaults to :func:`locale.getencoding`. ``encoding="locale"`` can be used to specify the current locale's encoding explicitly. See :ref:`io-text-encoding` for more information.