'JIS', 1=>'UTF-8', 2=>'EUC-JP', 3=>'SJIS'); $s = $jis; $s = mb_convert_encoding($s, 'EUC-JP', $a); print("EUC-JP: $s\n"); // EUC-JP $s = $euc_jp; $s = mb_convert_encoding($s, 'SJIS', $a); print("SJIS: ".base64_encode($s)."\n"); // SJIS $s = $euc_jp; $s = mb_convert_encoding($s, 'JIS', $a); print("JIS: ".base64_encode($s)."\n"); // JIS // Using Detect Order echo "== DETECT ORDER ==\n"; $s = $jis; $s = mb_convert_encoding($s, 'EUC-JP', 'auto'); print("EUC-JP: $s\n"); // EUC-JP $s = $euc_jp; $s = mb_convert_encoding($s, 'SJIS', 'auto'); print("SJIS: ".base64_encode($s)."\n"); // SJIS $s = $euc_jp; $s = mb_convert_encoding($s, 'JIS', 'auto'); print("JIS: ".base64_encode($s)."\n"); // JIS // Invalid(?) Parameters echo "== INVALID PARAMETER ==\n"; $s = mb_convert_encoding(1234, 'EUC-JP'); print("INT: $s\n"); // EUC-JP $s = mb_convert_encoding('', 'EUC-JP'); print("EUC-JP: $s\n"); // SJIS $s = $euc_jp; $s = mb_convert_encoding($s, 'BAD'); print("BAD: $s\n"); // BAD $s = $euc_jp; $s = mb_convert_encoding($s); print("MP: $s\n"); // Missing parameter ?>