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:
Walter Dörwald 2009-05-06 14:28:24 +00:00
parent c924b3d115
commit a7fb408a02
2 changed files with 8 additions and 3 deletions

View file

@ -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))