Skip to content

Commit d7eb442

Browse files
committed
Add more tests for ISO-2022-JP-2004 text conversion
1 parent 907d0c3 commit d7eb442

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ext/mbstring/tests/iso2022jp_2004_encoding.phpt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,11 @@ convertInvalidString("\xE0", "%", "ISO-2022-JP-2004", "UTF-8");
320320
convertInvalidString("\x1B\$(X", "%", "ISO-2022-JP-2004", "UTF-8"); // Invalid escape
321321
convertInvalidString("\x1B\$B!", "%", "ISO-2022-JP-2004", "UTF-8"); // Truncated character
322322

323+
// Test sequences of 2 Unicode codepoints which convert to a single character in ISO-2022-JP-2004
324+
testValidString("\x02\x54\x03\x00", "\x1B\$(Q+H\x1B(B", "UTF-16BE", "ISO-2022-JP-2004");
325+
// Including the case where such a codepoint is followed by one which it can't combine with
326+
testValidString("\x02\x54\x00A", "\x1B\$(Q+8\x1B(BA", "UTF-16BE", "ISO-2022-JP-2004");
327+
323328
echo "All done!\n";
324329

325330
?>

0 commit comments

Comments
 (0)