d672fcab |
1 | <?php |
d6c32258 |
2 | /** |
d672fcab |
3 | * decode/iso8859-10.php |
d672fcab |
4 | * |
6c84ba1e |
5 | * Copyright (c) 2003-2005 The SquirrelMail Project Team |
d672fcab |
6 | * Licensed under the GNU GPL. For full terms see the file COPYING. |
7 | * |
8 | * This file contains iso-8859-10 decoding function that is needed to read |
9 | * iso-8859-10 encoded mails in non-iso-8859-10 locale. |
91e0dccc |
10 | * |
d672fcab |
11 | * Original data taken from: |
12 | * ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-10.TXT |
13 | * |
14 | * Name: ISO/IEC 8859-10:1998 to Unicode |
15 | * Unicode version: 3.0 |
16 | * Table version: 1.1 |
17 | * Table format: Format A |
18 | * Date: 1999 October 11 |
19 | * Authors: Ken Whistler <kenw@sybase.com> |
20 | * |
21 | * Original copyright: |
e53c9681 |
22 | * Copyright (c) 1999 Unicode, Inc. All Rights reserved. |
d672fcab |
23 | * |
e53c9681 |
24 | * This file is provided as-is by Unicode, Inc. (The Unicode Consortium). |
25 | * No claims are made as to fitness for any particular purpose. No |
26 | * warranties of any kind are expressed or implied. The recipient |
27 | * agrees to determine applicability of information provided. If this |
28 | * file has been provided on optical media by Unicode, Inc., the sole |
29 | * remedy for any claim will be exchange of defective media within 90 |
30 | * days of receipt. |
d672fcab |
31 | * |
e53c9681 |
32 | * Unicode, Inc. hereby grants the right to freely use the information |
33 | * supplied in this file in the creation of products supporting the |
34 | * Unicode Standard, and to make copies of this file in any form for |
35 | * internal or external distribution as long as this notice remains |
36 | * attached. |
31841a9e |
37 | * |
38 | * @version $Id$ |
d6c32258 |
39 | * @package squirrelmail |
40 | * @subpackage decode |
41 | */ |
42 | |
43 | /** |
44 | * Decode iso-8859-10 encoded string |
45 | * @param string $string Encoded string |
46 | * @return string $string Decoded string |
d672fcab |
47 | */ |
df8c4d6d |
48 | function charset_decode_iso_8859_10 ($string) { |
e53c9681 |
49 | // don't do decoding when there are no 8bit symbols |
50 | if (! sq_is8bit($string,'iso-8859-10')) |
d672fcab |
51 | return $string; |
52 | |
53 | $iso8859_10 = array( |
e53c9681 |
54 | "\xA0" => ' ', |
55 | "\xA1" => 'Ą', |
56 | "\xA2" => 'Ē', |
57 | "\xA3" => 'Ģ', |
58 | "\xA4" => 'Ī', |
59 | "\xA5" => 'Ĩ', |
60 | "\xA6" => 'Ķ', |
61 | "\xA7" => '§', |
62 | "\xA8" => 'Ļ', |
63 | "\xA9" => 'Đ', |
64 | "\xAA" => 'Š', |
65 | "\xAB" => 'Ŧ', |
66 | "\xAC" => 'Ž', |
67 | "\xAD" => '­', |
68 | "\xAE" => 'Ū', |
69 | "\xAF" => 'Ŋ', |
70 | "\xB0" => '°', |
71 | "\xB1" => 'ą', |
72 | "\xB2" => 'ē', |
73 | "\xB3" => 'ģ', |
74 | "\xB4" => 'ī', |
75 | "\xB5" => 'ĩ', |
76 | "\xB6" => 'ķ', |
77 | "\xB7" => '·', |
78 | "\xB8" => 'ļ', |
79 | "\xB9" => 'đ', |
80 | "\xBA" => 'š', |
81 | "\xBB" => 'ŧ', |
82 | "\xBC" => 'ž', |
83 | "\xBD" => '―', |
84 | "\xBE" => 'ū', |
85 | "\xBF" => 'ŋ', |
86 | "\xC0" => 'Ā', |
87 | "\xC1" => 'Á', |
88 | "\xC2" => 'Â', |
89 | "\xC3" => 'Ã', |
90 | "\xC4" => 'Ä', |
91 | "\xC5" => 'Å', |
92 | "\xC6" => 'Æ', |
93 | "\xC7" => 'Į', |
94 | "\xC8" => 'Č', |
95 | "\xC9" => 'É', |
96 | "\xCA" => 'Ę', |
97 | "\xCB" => 'Ë', |
98 | "\xCC" => 'Ė', |
99 | "\xCD" => 'Í', |
100 | "\xCE" => 'Î', |
101 | "\xCF" => 'Ï', |
102 | "\xD0" => 'Ð', |
103 | "\xD1" => 'Ņ', |
104 | "\xD2" => 'Ō', |
105 | "\xD3" => 'Ó', |
106 | "\xD4" => 'Ô', |
107 | "\xD5" => 'Õ', |
108 | "\xD6" => 'Ö', |
109 | "\xD7" => 'Ũ', |
110 | "\xD8" => 'Ø', |
111 | "\xD9" => 'Ų', |
112 | "\xDA" => 'Ú', |
113 | "\xDB" => 'Û', |
114 | "\xDC" => 'Ü', |
115 | "\xDD" => 'Ý', |
116 | "\xDE" => 'Þ', |
117 | "\xDF" => 'ß', |
118 | "\xE0" => 'ā', |
119 | "\xE1" => 'á', |
120 | "\xE2" => 'â', |
121 | "\xE3" => 'ã', |
122 | "\xE4" => 'ä', |
123 | "\xE5" => 'å', |
124 | "\xE6" => 'æ', |
125 | "\xE7" => 'į', |
126 | "\xE8" => 'č', |
127 | "\xE9" => 'é', |
128 | "\xEA" => 'ę', |
129 | "\xEB" => 'ë', |
130 | "\xEC" => 'ė', |
131 | "\xED" => 'í', |
132 | "\xEE" => 'î', |
133 | "\xEF" => 'ï', |
134 | "\xF0" => 'ð', |
135 | "\xF1" => 'ņ', |
136 | "\xF2" => 'ō', |
137 | "\xF3" => 'ó', |
138 | "\xF4" => 'ô', |
139 | "\xF5" => 'õ', |
140 | "\xF6" => 'ö', |
141 | "\xF7" => 'ũ', |
142 | "\xF8" => 'ø', |
143 | "\xF9" => 'ų', |
144 | "\xFA" => 'ú', |
145 | "\xFB" => 'û', |
146 | "\xFC" => 'ü', |
147 | "\xFD" => 'ý', |
148 | "\xFE" => 'þ', |
149 | "\xFF" => 'ĸ' |
d672fcab |
150 | ); |
151 | |
152 | $string = str_replace(array_keys($iso8859_10), array_values($iso8859_10), $string); |
153 | |
154 | return $string; |
155 | } |
156 | |
e53c9681 |
157 | ?> |