From 7af26ef836641288a0a4a4e0deff817b1ca60878 Mon Sep 17 00:00:00 2001 From: tokul Date: Sun, 17 Aug 2003 14:04:29 +0000 Subject: [PATCH] Added tis-620 decoding git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5508 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/decode/tis620.php | 153 ++++++++++++++++++++++++++++++++++++ functions/i18n.php | 3 + 2 files changed, 156 insertions(+) create mode 100644 functions/decode/tis620.php diff --git a/functions/decode/tis620.php b/functions/decode/tis620.php new file mode 100644 index 00000000..8e1b4d71 --- /dev/null +++ b/functions/decode/tis620.php @@ -0,0 +1,153 @@ + '￿', + "\xA1" => 'ก', + "\xA2" => 'ข', + "\xA3" => 'ฃ', + "\xA4" => 'ค', + "\xA5" => 'ฅ', + "\xA6" => 'ฆ', + "\xA7" => 'ง', + "\xA8" => 'จ', + "\xA9" => 'ฉ', + "\xAA" => 'ช', + "\xAB" => 'ซ', + "\xAC" => 'ฌ', + "\xAD" => 'ญ', + "\xAE" => 'ฎ', + "\xAF" => 'ฏ', + "\xB0" => 'ฐ', + "\xB1" => 'ฑ', + "\xB2" => 'ฒ', + "\xB3" => 'ณ', + "\xB4" => 'ด', + "\xB5" => 'ต', + "\xB6" => 'ถ', + "\xB7" => 'ท', + "\xB8" => 'ธ', + "\xB9" => 'น', + "\xBA" => 'บ', + "\xBB" => 'ป', + "\xBC" => 'ผ', + "\xBD" => 'ฝ', + "\xBE" => 'พ', + "\xBF" => 'ฟ', + "\xC0" => 'ภ', + "\xC1" => 'ม', + "\xC2" => 'ย', + "\xC3" => 'ร', + "\xC4" => 'ฤ', + "\xC5" => 'ล', + "\xC6" => 'ฦ', + "\xC7" => 'ว', + "\xC8" => 'ศ', + "\xC9" => 'ษ', + "\xCA" => 'ส', + "\xCB" => 'ห', + "\xCC" => 'ฬ', + "\xCD" => 'อ', + "\xCE" => 'ฮ', + "\xCF" => 'ฯ', + "\xD0" => 'ะ', + "\xD1" => 'ั', + "\xD2" => 'า', + "\xD3" => 'ำ', + "\xD4" => 'ิ', + "\xD5" => 'ี', + "\xD6" => 'ึ', + "\xD7" => 'ื', + "\xD8" => 'ุ', + "\xD9" => 'ู', + "\xDA" => 'ฺ', + "\xDB" => '￿', + "\xDC" => '￿', + "\xDD" => '￿', + "\xDE" => '￿', + "\xDF" => '฿', + "\xE0" => 'เ', + "\xE1" => 'แ', + "\xE2" => 'โ', + "\xE3" => 'ใ', + "\xE4" => 'ไ', + "\xE5" => 'ๅ', + "\xE6" => 'ๆ', + "\xE7" => '็', + "\xE8" => '่', + "\xE9" => '้', + "\xEA" => '๊', + "\xEB" => '๋', + "\xEC" => '์', + "\xED" => 'ํ', + "\xEE" => '๎', + "\xEF" => '๏', + "\xF0" => '๐', + "\xF1" => '๑', + "\xF2" => '๒', + "\xF3" => '๓', + "\xF4" => '๔', + "\xF5" => '๕', + "\xF6" => '๖', + "\xF7" => '๗', + "\xF8" => '๘', + "\xF9" => '๙', + "\xFA" => '๚', + "\xFB" => '๛', + "\xFC" => '￿', + "\xFD" => '￿', + "\xFE" => '￿', + "\xFF" => '￿' + ); + + $string = str_replace(array_keys($tis620), array_values($tis620), $string); + + return $string; +} + +?> \ No newline at end of file diff --git a/functions/i18n.php b/functions/i18n.php index 524b5c3e..83467734 100644 --- a/functions/i18n.php +++ b/functions/i18n.php @@ -160,6 +160,9 @@ function charset_decode ($charset, $string) { } else if ($charset == 'windows-1258') { include_once(SM_PATH . 'functions/decode/cp1258.php'); $ret = charset_decode_cp1258 ($string); + } else if ($charset == 'tis-620') { + include_once(SM_PATH . 'functions/decode/tis620.php'); + $ret = charset_decode_tis620 ($string); } else if ($charset == 'big5' and $agresive_decoding ) { include_once(SM_PATH . 'functions/decode/big5.php'); $ret = charset_decode_big5 ($string); -- 2.25.1