mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00
Issue #11461: Fix the incremental UTF-16 decoder. Original patch by
Amaury Forgeot d'Arc. Added tests for partial decoding of non-BMP characters.
This commit is contained in:
commit
ae3b32ad6b
3 changed files with 47 additions and 9 deletions
|
@ -5284,8 +5284,11 @@ PyUnicode_DecodeUTF16Stateful(const char *s,
|
|||
/* The remaining input chars are ignored if the callback
|
||||
chooses to skip the input */
|
||||
case 1:
|
||||
q -= 2;
|
||||
if (consumed)
|
||||
goto End;
|
||||
errmsg = "unexpected end of data";
|
||||
startinpos = ((const char *)q) - 2 - starts;
|
||||
startinpos = ((const char *)q) - starts;
|
||||
endinpos = ((const char *)e) - starts;
|
||||
break;
|
||||
case 2:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue