Lines Matching refs:SJIS
2 Exhaustive test of SJIS-2004 encoding verification and conversion
15 /* Read in the table of all characters in SJIS-2004 */
16 $validChars = array(); /* SJIS-2004 string -> UTF-32BE string */
17 $fromUnicode = array(); /* UTF-16BE -> SJIS-2004 */
18 $fp = fopen(__DIR__ . '/data/SJIS-2004.txt', 'r+');
30 * 'fullwidth' version of a character; our implementation of SJIS-2004
44 testAllValidChars($validChars, 'SJIS-2004', 'UTF-32BE');
45 echo "SJIS-2004 verification and conversion works for all valid characters\n";
49 testAllInvalidChars($invalidChars, $validChars, 'SJIS-2004', 'UTF-32BE', "\x00\x00\x00%");
50 testTruncatedChars($truncated, 'SJIS-2004', 'UTF-32BE', "\x00\x00\x00%");
51 echo "SJIS-2004 verification and conversion rejects all invalid characters\n";
53 testAllValidChars($fromUnicode, 'UTF-16BE', 'SJIS-2004', false);
54 echo "Unicode -> SJIS-2004 conversion works on all valid characters\n";
57 convertAllInvalidChars($invalidChars, $fromUnicode, 'UTF-16BE', 'SJIS-2004', '%');
58 echo "Unicode -> SJIS-2004 conversion works on all invalid characters\n";
60 // Some pairs of Unicode codepoints are represented by a single character in SJIS-2004
63 convertValidString("\x30\x4B\x00A", "\x82\xA9A", 'UTF-16BE', 'SJIS-2004', false);
67 convertInvalidString("\x80", "%", "SJIS-2004", "UTF-8");
68 convertInvalidString("\x81\x20", "%", "SJIS-2004", "UTF-8");
69 convertInvalidString("\xFC\xF5", "%", "SJIS-2004", "UTF-8");
74 SJIS-2004 verification and conversion works for all valid characters
75 SJIS-2004 verification and conversion rejects all invalid characters
76 Unicode -> SJIS-2004 conversion works on all valid characters
77 Unicode -> SJIS-2004 conversion works on all invalid characters