mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Change PyUnicode_EncodeUTF16() so that it returns
bytes objects instead of str8 objects.
This commit is contained in:
parent
bf58bd6ddb
commit
3cc3452e3c
1 changed files with 2 additions and 2 deletions
|
@ -1726,12 +1726,12 @@ PyUnicode_EncodeUTF16(const Py_UNICODE *s,
|
|||
if (s[i] >= 0x10000)
|
||||
pairs++;
|
||||
#endif
|
||||
v = PyString_FromStringAndSize(NULL,
|
||||
v = PyBytes_FromStringAndSize(NULL,
|
||||
2 * (size + pairs + (byteorder == 0)));
|
||||
if (v == NULL)
|
||||
return NULL;
|
||||
|
||||
p = (unsigned char *)PyString_AS_STRING(v);
|
||||
p = (unsigned char *)PyBytes_AS_STRING(v);
|
||||
if (byteorder == 0)
|
||||
STORECHAR(0xFEFF);
|
||||
if (size == 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue