Summary
UTF-8で変換できない機種依存文字を置換する[2006-06-19-13] のEUC-JP版 のつもり.追記 [2006-08-09]
結果は失敗.文字化け発生.
Source
function replaceText($str){
$arr = array(
// ADA0 - ADB4
"\xAD\xA1" => "(1)",
"\xAD\xA2" => "(2)",
"\xAD\xA3" => "(3)",
"\xAD\xA4" => "(4)",
"\xAD\xA5" => "(5)",
"\xAD\xA6" => "(6)",
"\xAD\xA7" => "(7)",
"\xAD\xA8" => "(8)",
"\xAD\xA9" => "(9)",
"\xAD\xAA" => "(10)",
"\xAD\xAB" => "(11)",
"\xAD\xAC" => "(12)",
"\xAD\xAD" => "(13)",
"\xAD\xAE" => "(14)",
"\xAD\xAF" => "(15)",
"\xAD\xB0" => "(16)",
"\xAD\xB1" => "(17)",
"\xAD\xB2" => "(18)",
"\xAD\xB3" => "(19)",
"\xAD\xB4" => "(20)",
// ADB5 - ADBF
"\xAD\xB5" => "I",
"\xAD\xB6" => "II",
"\xAD\xB7" => "III",
"\xAD\xB8" => "IV",
"\xAD\xB9" => "V",
"\xAD\xBA" => "VI",
"\xAD\xBB" => "VII",
"\xAD\xBC" => "VIII",
"\xAD\xBD" => "IX",
"\xAD\xBE" => "X",
"\xAD\xBF" => "?",
"\xAD\xC0" => "ミリ",
"\xAD\xC1" => "キロ",
"\xAD\xC2" => "センチ",
"\xAD\xC3" => "メートル",
"\xAD\xC4" => "グラム",
"\xAD\xC5" => "トン",
"\xAD\xC6" => "アール",
"\xAD\xC7" => "ヘクタール",
"\xAD\xC8" => "リットル",
"\xAD\xC9" => "ワット",
"\xAD\xCA" => "カロリー",
"\xAD\xCB" => "ドル",
"\xAD\xCC" => "セント",
"\xAD\xCD" => "パーセント",
"\xAD\xCE" => "ミリバール",
"\xAD\xCF" => "ページ",
"\xAD\xD0" => "mm",
"\xAD\xD1" => "cm",
"\xAD\xD2" => "km",
"\xAD\xD3" => "mg",
"\xAD\xD4" => "kg",
"\xAD\xD5" => "cc",
"\xAD\xD6" => "m2",
"\xAD\xDF" => "平成",
"\xAD\xE0" => "``",
"\xAD\xE1" => "''",
"\xAD\xE2" => "No.",
"\xAD\xE3" => "K.K.",
"\xAD\xE4" => "",
"\xAD\xE5" => "(上)",
"\xAD\xE6" => "(中)",
"\xAD\xE7" => "(下)",
"\xAD\xE8" => "(左)",
"\xAD\xE9" => "(右)",
"\xAD\xEA" => "(株)",
"\xAD\xEB" => "(有)",
"\xAD\xEC" => "(代)",
"\xAD\xED" => "明治",
"\xAD\xEE" => "大正",
"\xAD\xEF" => "昭和",
"\xAD\xF0" => "",
"\xAD\xF1" => "",
"\xAD\xF2" => "",
"\xAD\xF3" => "",
"\xAD\xF4" => "",
"\xAD\xF5" => "",
"\xAD\xF6" => "",
"\xAD\xF7" => "",
"\xAD\xF8" => "",
"\xAD\xF9" => "",
"\xAD\xFA" => "",
"\xAD\xFB" => "",
"\xAD\xFC" => "",
"\xFC\xF1" => "i",
"\xFC\xF2" => "ii",
"\xFC\xF3" => "iii",
"\xFC\xF4" => "iv",
"\xFC\xF5" => "v",
"\xFC\xF6" => "vi",
"\xFC\xF7" => "vii",
"\xFC\xF8" => "viii",
"\xFC\xF9" => "ix",
"\xFC\xFA" => "x",
);
return strtr($str,$arr);
}
Reference
文字コード表http://ash.jp/code/codetbl2.htm