mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Issue 3739: The unicode-internal encoder now reports the number of *characters*
consumed like any other encoder (instead of the number of bytes).
This commit is contained in:
parent
c924b3d115
commit
a7fb408a02
2 changed files with 8 additions and 3 deletions
|
@ -646,7 +646,7 @@ unicode_internal_encode(PyObject *self,
|
|||
data = PyUnicode_AS_DATA(obj);
|
||||
size = PyUnicode_GET_DATA_SIZE(obj);
|
||||
return codec_tuple(PyString_FromStringAndSize(data, size),
|
||||
size);
|
||||
PyUnicode_GET_SIZE(obj));
|
||||
}
|
||||
else {
|
||||
if (PyObject_AsReadBuffer(obj, (const void **)&data, &size))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue