]> granicus.if.org Git - python/commit
[3.6] bpo-32555: Fix locale encodings (#5193)
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 15 Jan 2018 22:43:24 +0000 (23:43 +0100)
committerGitHub <noreply@github.com>
Mon, 15 Jan 2018 22:43:24 +0000 (23:43 +0100)
commitb92c159efada05b3a5ff9d0dbce3fcb2334631f6
treee0c7a7c67133cd4b7e6b17383ff69e2b7e5e11cc
parent5f959c4f9eca404b8bc4bc6348fed27c4b907b89
[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.
Doc/c-api/sys.rst
Doc/c-api/unicode.rst
Include/fileutils.h
Misc/NEWS.d/next/Library/2018-01-15-17-52-47.bpo-32555.CMq2zF.rst [new file with mode: 0644]
Objects/unicodeobject.c
Python/fileutils.c