Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-42236: Enhance _locale._get_locale_encoding() #23083

Merged
merged 1 commit into from Nov 1, 2020
Merged

bpo-42236: Enhance _locale._get_locale_encoding() #23083

merged 1 commit into from Nov 1, 2020

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Nov 1, 2020

  • Rename _Py_GetLocaleEncoding() to _Py_GetLocaleEncodingObject()
  • Add _Py_GetLocaleEncoding() which returns a wchar_t* string to
    share code between _Py_GetLocaleEncodingObject()
    and config_get_locale_encoding().
  • _Py_GetLocaleEncodingObject() now decodes nl_langinfo(CODESET)
    from the current locale encoding with surrogateescape,
    rather than using UTF-8.

https://bugs.python.org/issue42236

* Rename _Py_GetLocaleEncoding() to _Py_GetLocaleEncodingObject()
* Add _Py_GetLocaleEncoding() which returns a wchar_t* string to
  share code between _Py_GetLocaleEncodingObject()
  and config_get_locale_encoding().
* _Py_GetLocaleEncodingObject() now decodes nl_langinfo(CODESET)
  from the current locale encoding with surrogateescape,
  rather than using UTF-8.
@vstinner vstinner merged commit 82458b6 into python:master Nov 1, 2020
@vstinner vstinner deleted the get_locale_encoding_obj branch November 1, 2020 20:13
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
* Rename _Py_GetLocaleEncoding() to _Py_GetLocaleEncodingObject()
* Add _Py_GetLocaleEncoding() which returns a wchar_t* string to
  share code between _Py_GetLocaleEncodingObject()
  and config_get_locale_encoding().
* _Py_GetLocaleEncodingObject() now decodes nl_langinfo(CODESET)
  from the current locale encoding with surrogateescape,
  rather than using UTF-8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants