mirror of
https://github.com/python/cpython.git
synced 2025-07-14 06:45:17 +00:00
#8271: merge with 3.3.
This commit is contained in:
commit
cfa9636404
4 changed files with 291 additions and 37 deletions
|
@ -4611,9 +4611,7 @@ PyUnicode_DecodeUTF8Stateful(const char *s,
|
|||
goto End;
|
||||
errmsg = "unexpected end of data";
|
||||
startinpos = s - starts;
|
||||
endinpos = startinpos + 1;
|
||||
while (endinpos < size && (starts[endinpos] & 0xC0) == 0x80)
|
||||
endinpos++;
|
||||
endinpos = end - starts;
|
||||
break;
|
||||
case 1:
|
||||
errmsg = "invalid start byte";
|
||||
|
@ -4621,11 +4619,11 @@ PyUnicode_DecodeUTF8Stateful(const char *s,
|
|||
endinpos = startinpos + 1;
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
errmsg = "invalid continuation byte";
|
||||
startinpos = s - starts;
|
||||
endinpos = startinpos + 1;
|
||||
while (endinpos < size && (starts[endinpos] & 0xC0) == 0x80)
|
||||
endinpos++;
|
||||
endinpos = startinpos + ch - 1;
|
||||
break;
|
||||
default:
|
||||
if (unicode_putchar(&unicode, &outpos, ch) < 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue