mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
Use locale encoding if Py_FileSystemDefaultEncoding is not set
* PyUnicode_EncodeFSDefault(), PyUnicode_DecodeFSDefaultAndSize() and PyUnicode_DecodeFSDefault() use the locale encoding instead of UTF-8 if Py_FileSystemDefaultEncoding is NULL * redecode_filenames() functions and _Py_code_object_list (issue #9630) are no more needed: remove them
This commit is contained in:
parent
6a4aff10f0
commit
f3170ccef8
8 changed files with 48 additions and 297 deletions
|
|
@ -415,7 +415,8 @@ used, passing :c:func:`PyUnicode_FSDecoder` as the conversion function:
|
|||
Decode a string using :c:data:`Py_FileSystemDefaultEncoding` and the
|
||||
``'surrogateescape'`` error handler, or ``'strict'`` on Windows.
|
||||
|
||||
If :c:data:`Py_FileSystemDefaultEncoding` is not set, fall back to UTF-8.
|
||||
If :c:data:`Py_FileSystemDefaultEncoding` is not set, fall back to the
|
||||
locale encoding.
|
||||
|
||||
.. versionchanged:: 3.2
|
||||
Use ``'strict'`` error handler on Windows.
|
||||
|
|
@ -426,7 +427,8 @@ used, passing :c:func:`PyUnicode_FSDecoder` as the conversion function:
|
|||
Decode a null-terminated string using :c:data:`Py_FileSystemDefaultEncoding`
|
||||
and the ``'surrogateescape'`` error handler, or ``'strict'`` on Windows.
|
||||
|
||||
If :c:data:`Py_FileSystemDefaultEncoding` is not set, fall back to UTF-8.
|
||||
If :c:data:`Py_FileSystemDefaultEncoding` is not set, fall back to the
|
||||
locale encoding.
|
||||
|
||||
Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` if you know the string length.
|
||||
|
||||
|
|
@ -440,7 +442,8 @@ used, passing :c:func:`PyUnicode_FSDecoder` as the conversion function:
|
|||
``'surrogateescape'`` error handler, or ``'strict'`` on Windows, and return
|
||||
:class:`bytes`.
|
||||
|
||||
If :c:data:`Py_FileSystemDefaultEncoding` is not set, fall back to UTF-8.
|
||||
If :c:data:`Py_FileSystemDefaultEncoding` is not set, fall back to the
|
||||
locale encoding.
|
||||
|
||||
.. versionadded:: 3.2
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue