[issue8092] utf8, backslashreplace and surrogates

STINNER Victor report at bugs.python.org
Tue Apr 20 21:38:49 CEST 2010


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

New version without the hardcoded limit: don't use goto encodeUCS4;, chain if to limit indentation depth: it only costs one copy of the UCS4 (5 lines are duplicated).

The buffer is now reallocated each time a surrogate escape is longer than 4 bytes.

I don't know if "nallocated += repsize - 4;" can overflow or not. If yes, how can I detect the overflow? I added: /* FIXME: check integer overflow? */

----------
Added file: http://bugs.python.org/file17010/utf8_surrogate_error-2.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8092>
_______________________________________


More information about the Python-bugs-list mailing list