1
0
mirror of https://github.com/php/php-src.git synced 2026-03-29 19:52:20 +02:00
Files
archived-php-src/ext/mbstring/tests
Alex Dowad d104481af8 Correct entry for 0x80,0xFD-FF in SJIS multi-byte character length table
As a performance optimization, mbstring implements some functions using
tables which give the (byte) length of a multi-byte character using a
lookup based on the value of the first byte. These tables are called
`mblen_table`.

For many years, the mblen_table for SJIS has had '2' in position 0x80.
That is wrong; it should have been '1'. Reasons:

For SJIS, SJIS-2004, and mobile variants of SJIS, 0x80 has never been
treated as the first byte of a 2-byte character. It has always been
treated as a single erroneous byte. On the other hand, 0x80 is a valid
character in MacJapanese... but a 1-byte character, not a 2-byte one.

The same applies to bytes 0xFD-FF; these are 1-byte characters in
MacJapanese, and in other SJIS variants, they are not valid (as the
first byte of a character).

Thanks to the GitHub user 'youkidearitai' for finding this problem.
2023-01-05 14:05:39 +02:00
..
2021-06-11 14:00:43 +02:00
2021-06-11 14:00:43 +02:00
2021-06-11 14:00:43 +02:00
2021-06-11 14:00:43 +02:00
2021-06-11 14:00:43 +02:00
2021-06-11 14:00:43 +02:00
2021-06-11 14:00:43 +02:00
2021-06-11 14:00:43 +02:00
2021-06-11 14:00:43 +02:00
2021-06-11 14:00:43 +02:00
2021-08-11 14:03:18 +02:00
2020-02-03 22:52:20 +01:00