mirror of
https://github.com/python/cpython.git
synced 2024-12-04 23:34:42 +08:00
_PyUnicode_Ready() for 16-bit wchar_t
This commit is contained in:
parent
2fd82278cb
commit
126c559d05
@ -1121,6 +1121,8 @@ _PyUnicode_Ready(PyObject *obj)
|
||||
_PyUnicode_STATE(unicode).kind = PyUnicode_4BYTE_KIND;
|
||||
_PyUnicode_UTF8(unicode) = NULL;
|
||||
_PyUnicode_UTF8_LENGTH(unicode) = 0;
|
||||
/* unicode_convert_wchar_to_ucs4() requires a ready string */
|
||||
_PyUnicode_STATE(unicode).ready = 1;
|
||||
unicode_convert_wchar_to_ucs4(_PyUnicode_WSTR(unicode), end, unicode);
|
||||
PyObject_FREE(_PyUnicode_WSTR(unicode));
|
||||
_PyUnicode_WSTR(unicode) = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user