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:
Victor Stinner 2010-10-15 12:04:23 +00:00
parent 6a4aff10f0
commit f3170ccef8
8 changed files with 48 additions and 297 deletions

View file

@ -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