]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Correct the documented default encoding (GH-18429)
authorEric Wieser <wieser.eric@gmail.com>
Mon, 10 Feb 2020 23:32:18 +0000 (23:32 +0000)
committerGitHub <noreply@github.com>
Mon, 10 Feb 2020 23:32:18 +0000 (15:32 -0800)
From the source for `PyUnicode_Decode`, the implementation is:
```
if (encoding == NULL) {
    return PyUnicode_DecodeUTF8Stateful(s, size, errors, NULL);
}
```
which is pretty clearly not defaulting to ASCII.

---

I assume this needs neither a news entry nor bpo link.

Doc/c-api/unicode.rst

index 77f123cf1f2c08c1bf117cdab6f1e1383aa2c785..96d77c4084132c17c1970b25fb612fa0f31d0e4f 100644 (file)
@@ -978,7 +978,7 @@ have the same semantics as the ones of the built-in :func:`str` string object
 constructor.
 
 Setting encoding to ``NULL`` causes the default encoding to be used
-which is ASCII.  The file system calls should use
+which is UTF-8.  The file system calls should use
 :c:func:`PyUnicode_FSConverter` for encoding file names. This uses the
 variable :c:data:`Py_FileSystemDefaultEncoding` internally. This
 variable should be treated as read-only: on some systems, it will be a