6 * This file contains tis620 decoding function that is needed to read
7 * tis620 encoded mails in non-tis620 locale.
9 * Original data taken from:
10 * http://www.inet.co.th/cyberclub/trin/thairef/tis620-iso10646.html
13 * Note: The information contained herein is provided as-is. It was
14 * complied from various references given at the end of the page.
15 * The author (trin@mozart.inet.co.th) believes all information
16 * presented here is accurate.
19 * 1. [1]TIS 620-2533 Standard for Thai Character Codes for Computers
20 * (in Thai), [2]Thai Industrial Standards Institute
21 * 2. [3]Thai Information Technology Standards, On-line resources at the
22 * National Electronics and Computer Technology Center (NECTEC)
23 * 3. ISO/IEC 10646-1, [4]ISO/IEC JTC1/SC2
24 * 4. [5]Thai block in Unicode 2.1, [6]Unicode Consortium
27 * 1. http://www.nectec.or.th/it-standards/std620/std620.htm
28 * 2. http://www.tisi.go.th/
29 * 3. http://www.nectec.or.th/it-standards/
30 * 4. http://wwwold.dkuug.dk/JTC1/SC2/
31 * 5. http://charts.unicode.org/Unicode.charts/normal/U0E00.html
32 * 6. http://www.unicode.org/
34 * @copyright © 2003-2006 The SquirrelMail Project Team
35 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
37 * @package squirrelmail
42 * Decode tis620 encoded strings
43 * @param string $string Encoded string
44 * @return string Decoded string
46 function charset_decode_tis_620 ($string) {
47 // don't do decoding when there are no 8bit symbols
48 if (! sq_is8bit($string,'tis-620'))
111 "\xDB" => '',
112 "\xDC" => '',
113 "\xDD" => '',
114 "\xDE" => '',
144 "\xFC" => '',
145 "\xFD" => '',
146 "\xFE" => '',
150 $string = str_replace(array_keys($tis620), array_values($tis620), $string);