diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-07-07 23:45:13 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-07-07 23:45:13 (GMT) |
commit | 2cded9c3f31d2fea4b033f44eaa828e508f03391 (patch) | |
tree | 1554d9f0baa575b7ae791ff1267c4e493a1b36bf /Modules/cjkcodecs/_codecs_hk.c | |
parent | 081fe46ff96bccb1a256c356443b625b467814c8 (diff) | |
download | cpython-2cded9c3f31d2fea4b033f44eaa828e508f03391.zip cpython-2cded9c3f31d2fea4b033f44eaa828e508f03391.tar.gz cpython-2cded9c3f31d2fea4b033f44eaa828e508f03391.tar.bz2 |
Issue #12016: Multibyte CJK decoders now resynchronize faster
They only ignore the first byte of an invalid byte sequence.
For example, b'\xff\n'.decode('gb2312', 'replace') gives '\ufffd\n' instead of
'\ufffd'.
Diffstat (limited to 'Modules/cjkcodecs/_codecs_hk.c')
-rw-r--r-- | Modules/cjkcodecs/_codecs_hk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/cjkcodecs/_codecs_hk.c b/Modules/cjkcodecs/_codecs_hk.c index 558a42f..d3ad04b 100644 --- a/Modules/cjkcodecs/_codecs_hk.c +++ b/Modules/cjkcodecs/_codecs_hk.c @@ -161,7 +161,7 @@ DECODER(big5hkscs) case 0x8864: WRITE2(0x00ca, 0x030c); break; case 0x88a3: WRITE2(0x00ea, 0x0304); break; case 0x88a5: WRITE2(0x00ea, 0x030c); break; - default: return 2; + default: return 1; } NEXT(2, 2) /* all decoded codepoints are pairs, above. */ |