diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2018-01-15 22:43:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-15 22:43:24 (GMT) |
commit | b92c159efada05b3a5ff9d0dbce3fcb2334631f6 (patch) | |
tree | e0c7a7c67133cd4b7e6b17383ff69e2b7e5e11cc /Include/fileutils.h | |
parent | 5f959c4f9eca404b8bc4bc6348fed27c4b907b89 (diff) | |
download | cpython-b92c159efada05b3a5ff9d0dbce3fcb2334631f6.zip cpython-b92c159efada05b3a5ff9d0dbce3fcb2334631f6.tar.gz cpython-b92c159efada05b3a5ff9d0dbce3fcb2334631f6.tar.bz2 |
[3.6] bpo-32555: Fix locale encodings (#5193)
On FreeBSD and Solaris, os.strerror() now always decode the byte
string from the current locale encoding, rather than using
ASCII/surrogateescape in some cases.
Changes:
* Add _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx() which has an
additional current_locale parameter.
* PyUnicode_DecodeLocale(), PyUnicode_DecodeLocaleAndSize() and
* PyUnicode_EncodeLocale() now always use the current locale
* encoding, instead of using Py_DecodeLocale()/Py_EncodeLocale().
* Document encoding in Py_DecodeLocale() and Py_EncodeLocale()
documentations.
* Add USE_FORCE_ASCII define to not define
decode_ascii_surrogateescape() on Android.
Diffstat (limited to 'Include/fileutils.h')
-rw-r--r-- | Include/fileutils.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Include/fileutils.h b/Include/fileutils.h index 875715d..8fa70ba 100644 --- a/Include/fileutils.h +++ b/Include/fileutils.h @@ -17,6 +17,16 @@ PyAPI_FUNC(char*) Py_EncodeLocale( #ifndef Py_LIMITED_API +PyAPI_FUNC(wchar_t *) _Py_DecodeLocaleEx( + const char *arg, + size_t *size, + int current_locale); + +PyAPI_FUNC(char*) _Py_EncodeLocaleEx( + const wchar_t *text, + size_t *error_pos, + int current_locale); + PyAPI_FUNC(PyObject *) _Py_device_encoding(int); #ifdef MS_WINDOWS |