'UTF-8',1=>'EUC-JP', 2=>'SJIS', 3=>'JIS'); $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"; mb_detect_order('auto'); $s = $jis; $s = mb_convert_encoding($s, 'EUC-JP'); print("EUC-JP: $s\n"); // EUC-JP $s = $euc_jp; $s = mb_convert_encoding($s, 'SJIS'); print("SJIS: ".base64_encode($s)."\n"); // SJIS $s = $euc_jp; $s = mb_convert_encoding($s, 'JIS'); 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 ?>