Commit b960b345 authored by Victor Stinner's avatar Victor Stinner

PyUnicode_AsUTF32String() calls directly _PyUnicode_EncodeUTF32(),

instead of calling the deprecated PyUnicode_EncodeUTF32() function
parent 77faf69c
...@@ -5150,12 +5150,7 @@ PyUnicode_EncodeUTF32(const Py_UNICODE *s, ...@@ -5150,12 +5150,7 @@ PyUnicode_EncodeUTF32(const Py_UNICODE *s,
PyObject * PyObject *
PyUnicode_AsUTF32String(PyObject *unicode) PyUnicode_AsUTF32String(PyObject *unicode)
{ {
const Py_UNICODE *wstr; return _PyUnicode_EncodeUTF32(unicode, NULL, 0);
Py_ssize_t wlen;
wstr = PyUnicode_AsUnicodeAndSize(unicode, &wlen);
if (wstr == NULL)
return NULL;
return PyUnicode_EncodeUTF32(wstr, wlen, NULL, 0);
} }
/* --- UTF-16 Codec ------------------------------------------------------- */ /* --- UTF-16 Codec ------------------------------------------------------- */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment