--TEST-- Exhaustive test of EUC-JP encoding verification and conversion --SKIPIF-- --FILE-- 2, 0x8F => 3)); /* In the JIS X 0212 character set, kuten code 0x2237 (EUC-JP 0x8FA2B7) * is an ordinary tilde character * This mapping is not reversible, because ASCII 0x7E also represents * the same character */ unset($validChars["\x8F\xA2\xB7"]); testAllValidChars($validChars, 'EUC-JP', 'UTF-32BE'); echo "Encoding verification and conversion work for all valid characters\n"; testAllInvalidChars($invalidChars, $validChars, 'EUC-JP', 'UTF-32BE', "\x00\x00\x00%"); testTruncatedChars($truncated, 'EUC-JP', 'UTF-32BE', "\x00\x00\x00%"); echo "Encoding verification and conversion work for all invalid characters\n"; testValidString("\x8F\xA2\xB7", "\x00\x00\x00~", 'EUC-JP', 'UTF-32BE', false); echo "Irreversible mapping of 0x8FA2B7 follows JIS X 0212 correctly\n"; testAllValidChars($fromUnicode, 'UTF-32BE', 'EUC-JP', false); echo "Unicode -> EUC-JP conversion works on all valid characters\n"; $invalidChars = array(); for ($cp = 0; $cp <= 0xFFFF; $cp++) { $char = pack('N', $cp); if (!isset($fromUnicode[$char])) $invalidChars[$char] = true; } convertAllInvalidChars($invalidChars, $fromUnicode, 'UTF-32BE', 'EUC-JP', '%'); echo "Unicode -> EUC-JP conversion works on all invalid characters\n"; ?> --EXPECT-- Encoding verification and conversion work for all valid characters Encoding verification and conversion work for all invalid characters Irreversible mapping of 0x8FA2B7 follows JIS X 0212 correctly Unicode -> EUC-JP conversion works on all valid characters Unicode -> EUC-JP conversion works on all invalid characters