mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
bpo-47000: Add locale.getencoding() (GH-32068)
This commit is contained in:
parent
cd29bd13ef
commit
6773203487
11 changed files with 88 additions and 46 deletions
|
|
@ -1779,7 +1779,13 @@ static PyStatus
|
|||
config_get_locale_encoding(PyConfig *config, const PyPreConfig *preconfig,
|
||||
wchar_t **locale_encoding)
|
||||
{
|
||||
wchar_t *encoding = _Py_GetLocaleEncoding();
|
||||
wchar_t *encoding;
|
||||
if (preconfig->utf8_mode) {
|
||||
encoding = _PyMem_RawWcsdup(L"utf-8");
|
||||
}
|
||||
else {
|
||||
encoding = _Py_GetLocaleEncoding();
|
||||
}
|
||||
if (encoding == NULL) {
|
||||
return _PyStatus_NO_MEMORY();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue