mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
Issue #16416: Fix compilation error
This commit is contained in:
parent
27b1ca29cc
commit
41a234a679
1 changed files with 3 additions and 1 deletions
|
@ -169,7 +169,9 @@ _Py_wchar2char(const wchar_t *text, size_t *error_pos)
|
|||
if (unicode == NULL)
|
||||
return NULL;
|
||||
|
||||
bytes = _PyUnicode_AsUTF8String(unicode, "surrogateescape");
|
||||
bytes = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode),
|
||||
PyUnicode_GET_SIZE(unicode),
|
||||
"surrogateescape");
|
||||
Py_DECREF(unicode);
|
||||
if (bytes == NULL) {
|
||||
PyErr_Clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue