diff options
author | Alex Dowad <alexinbeijing@gmail.com> | 2020-09-14 21:07:03 +0200 |
---|---|---|
committer | Alex Dowad <alexinbeijing@gmail.com> | 2021-01-14 22:31:31 +0200 |
commit | b67e358e75fc55ec802215fac0ca5a8e21b1f307 (patch) | |
tree | dd324fb3a9c55ce5d26cfc783f15bbe213b9e63f /ext/json/php_json.h | |
parent | d497c0e96f0347707df717aba047e059658f3f68 (diff) | |
download | php-git-b67e358e75fc55ec802215fac0ca5a8e21b1f307.tar.gz |
JIS7/JIS8 encoding: handle invalid 2nd byte for Kanji correctly
Previously, in ISO-2022-JP/JIS7/JIS8, if an escape sequence (starting with 0x1B)
appeared where the 2nd byte of a multibyte character should have been, mbstring
would forget all about the truncated multibyte character and happily accept the
escape sequence. However, such sequences are not legal and should be flagged as
errors.
Also, any other illegal bytes appearing where the 2nd byte of a multibyte
character was expected were just passed through quietly to the output. Fix that.
Also add a test suite for both ISO-2022-JP and JIS7/JIS8. (These are extremely
similar encodings; JIS7 and JIS8 are variants of ISO-2022-JP. mbstring's 'JIS'
is actually a combination of JIS7 _and_ JIS8, since the extensions which each
one adds to ISO-2022-JP are disjoint.)
Diffstat (limited to 'ext/json/php_json.h')
0 files changed, 0 insertions, 0 deletions