gh-93103: Update PyUnicode_DecodeFSDefault() doc (#93105)

Update documentation of PyUnicode_DecodeFSDefault(),
PyUnicode_DecodeFSDefaultAndSize() and PyUnicode_EncodeFSDefault():
they now use the filesystem encoding and error handler of PyConfig,
Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors
variables are no longer used.
This commit is contained in:
Victor Stinner 2022-05-23 14:56:59 +02:00 committed by GitHub
parent 764e83db85
commit fc00667247
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 60 deletions

View file

@ -755,38 +755,22 @@ PyAPI_FUNC(int) PyUnicode_FSConverter(PyObject*, void*);
PyAPI_FUNC(int) PyUnicode_FSDecoder(PyObject*, void*);
/* Decode a null-terminated string using Py_FileSystemDefaultEncoding
and the "surrogateescape" error handler.
If Py_FileSystemDefaultEncoding is not set, fall back to the locale
encoding.
Use PyUnicode_DecodeFSDefaultAndSize() if the string length is known.
*/
/* Decode a null-terminated string from the Python filesystem encoding
and error handler.
If the string length is known, use PyUnicode_DecodeFSDefaultAndSize(). */
PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefault(
const char *s /* encoded string */
);
/* Decode a string using Py_FileSystemDefaultEncoding
and the "surrogateescape" error handler.
If Py_FileSystemDefaultEncoding is not set, fall back to the locale
encoding.
*/
/* Decode a string from the Python filesystem encoding and error handler. */
PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefaultAndSize(
const char *s, /* encoded string */
Py_ssize_t size /* size */
);
/* Encode a Unicode object to Py_FileSystemDefaultEncoding with the
"surrogateescape" error handler, and return bytes.
If Py_FileSystemDefaultEncoding is not set, fall back to the locale
encoding.
*/
/* Encode a Unicode object to the Python filesystem encoding and error handler.
Return bytes. */
PyAPI_FUNC(PyObject*) PyUnicode_EncodeFSDefault(
PyObject *unicode
);