Commit 3cc3452e authored by Walter Dörwald's avatar Walter Dörwald

Change PyUnicode_EncodeUTF16() so that it returns

bytes objects instead of str8 objects.
parent bf58bd6d
...@@ -1726,12 +1726,12 @@ PyUnicode_EncodeUTF16(const Py_UNICODE *s, ...@@ -1726,12 +1726,12 @@ PyUnicode_EncodeUTF16(const Py_UNICODE *s,
if (s[i] >= 0x10000) if (s[i] >= 0x10000)
pairs++; pairs++;
#endif #endif
v = PyString_FromStringAndSize(NULL, v = PyBytes_FromStringAndSize(NULL,
2 * (size + pairs + (byteorder == 0))); 2 * (size + pairs + (byteorder == 0)));
if (v == NULL) if (v == NULL)
return NULL; return NULL;
p = (unsigned char *)PyString_AS_STRING(v); p = (unsigned char *)PyBytes_AS_STRING(v);
if (byteorder == 0) if (byteorder == 0)
STORECHAR(0xFEFF); STORECHAR(0xFEFF);
if (size == 0) if (size == 0)
......
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