Skip to content

Commit 0de4d68

Browse files
committed
Add more tests for SJIS-2004 text conversion
1 parent c7d47cb commit 0de4d68

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ext/mbstring/tests/sjis2004_encoding.phpt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ findInvalidChars($fromUnicode, $invalidChars, $unused, array_fill_keys(range(0,
6161
convertAllInvalidChars($invalidChars, $fromUnicode, 'UTF-16BE', 'SJIS-2004', '%');
6262
echo "Unicode -> SJIS-2004 conversion works on all invalid characters\n";
6363

64+
// Some pairs of Unicode codepoints are represented by a single character in SJIS-2004
65+
// Test the case where the first codepoint looks like it might be one of these pairs...
66+
// but the second one doesn't match
67+
convertValidString("\x30\x4B\x00A", "\x82\xA9A", 'UTF-16BE', 'SJIS-2004', false);
68+
6469
// Test "long" illegal character markers
6570
mb_substitute_character("long");
6671
convertInvalidString("\x80", "BAD+80", "SJIS-2004", "UTF-8");

0 commit comments

Comments
 (0)