From: Victor Stinner Date: Mon, 3 Oct 2011 02:17:10 +0000 (+0200) Subject: _PyUnicode_Ready() for 16-bit wchar_t X-Git-Tag: v3.3.0a1~1375 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=126c559d0588629a3317b66b3061cb82c67ffb89;p=thirdparty%2FPython%2Fcpython.git _PyUnicode_Ready() for 16-bit wchar_t --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 4a7815394eb1..9c02817b9da4 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -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;