mirror of
https://github.com/python/cpython.git
synced 2025-10-06 15:11:58 +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
|
@ -1193,7 +1193,8 @@ 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 UTF-8.
|
||||
If Py_FileSystemDefaultEncoding is not set, fall back to the locale
|
||||
encoding.
|
||||
|
||||
Use PyUnicode_DecodeFSDefaultAndSize() if the string length is known.
|
||||
*/
|
||||
|
@ -1205,7 +1206,8 @@ PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefault(
|
|||
/* Decode a string using Py_FileSystemDefaultEncoding
|
||||
and the "surrogateescape" error handler.
|
||||
|
||||
If Py_FileSystemDefaultEncoding is not set, fall back to UTF-8.
|
||||
If Py_FileSystemDefaultEncoding is not set, fall back to the locale
|
||||
encoding.
|
||||
*/
|
||||
|
||||
PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefaultAndSize(
|
||||
|
@ -1216,7 +1218,8 @@ PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefaultAndSize(
|
|||
/* Encode a Unicode object to Py_FileSystemDefaultEncoding with the
|
||||
"surrogateescape" error handler, and return bytes.
|
||||
|
||||
If Py_FileSystemDefaultEncoding is not set, fall back to UTF-8.
|
||||
If Py_FileSystemDefaultEncoding is not set, fall back to the locale
|
||||
encoding.
|
||||
*/
|
||||
|
||||
PyAPI_FUNC(PyObject*) PyUnicode_EncodeFSDefault(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue