From 126c559d0588629a3317b66b3061cb82c67ffb89 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 3 Oct 2011 04:17:10 +0200 Subject: _PyUnicode_Ready() for 16-bit wchar_t --- Objects/unicodeobject.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 4a78153..9c02817 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; -- cgit v0.12