d672fcab |
1 | <?php |
d6c32258 |
2 | /** |
d672fcab |
3 | * decode/iso8859-8.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-8 decoding function that is needed to read |
9 | * iso-8859-8 encoded mails in non-iso-8859-8 locale. |
91e0dccc |
10 | * |
d672fcab |
11 | * Original data taken from: |
12 | * ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-8.TXT |
13 | * |
14 | * Name: ISO/IEC 8859-8:1999 to Unicode |
15 | * Unicode version: 3.0 |
16 | * Table version: 1.1 |
17 | * Table format: Format A |
18 | * Date: 2000-Jan-03 |
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 iso8859-8 encoded strings |
45 | * @param string $string Encoded string |
46 | * @return string $string Decoded string |
d672fcab |
47 | */ |
df8c4d6d |
48 | function charset_decode_iso_8859_8 ($string) { |
e53c9681 |
49 | // don't do decoding when there are no 8bit symbols |
50 | if (! sq_is8bit($string,'iso-8859-8')) |
d672fcab |
51 | return $string; |
52 | |
53 | $iso8859_8 = array( |
e53c9681 |
54 | "\xA0" => ' ', |
55 | "\xA2" => '¢', |
56 | "\xA3" => '£', |
57 | "\xA4" => '¤', |
58 | "\xA5" => '¥', |
59 | "\xA6" => '¦', |
60 | "\xA7" => '§', |
61 | "\xA8" => '¨', |
62 | "\xA9" => '©', |
63 | "\xAA" => '×', |
64 | "\xAB" => '«', |
65 | "\xAC" => '¬', |
66 | "\xAD" => '­', |
67 | "\xAE" => '®', |
68 | "\xAF" => '¯', |
69 | "\xB0" => '°', |
70 | "\xB1" => '±', |
71 | "\xB2" => '²', |
72 | "\xB3" => '³', |
73 | "\xB4" => '´', |
74 | "\xB5" => 'µ', |
75 | "\xB6" => '¶', |
76 | "\xB7" => '·', |
77 | "\xB8" => '¸', |
78 | "\xB9" => '¹', |
79 | "\xBA" => '÷', |
80 | "\xBB" => '»', |
81 | "\xBC" => '¼', |
82 | "\xBD" => '½', |
83 | "\xBE" => '¾', |
84 | "\xDF" => '‗', |
85 | "\xE0" => 'א', |
86 | "\xE1" => 'ב', |
87 | "\xE2" => 'ג', |
88 | "\xE3" => 'ד', |
89 | "\xE4" => 'ה', |
90 | "\xE5" => 'ו', |
91 | "\xE6" => 'ז', |
92 | "\xE7" => 'ח', |
93 | "\xE8" => 'ט', |
94 | "\xE9" => 'י', |
95 | "\xEA" => 'ך', |
96 | "\xEB" => 'כ', |
97 | "\xEC" => 'ל', |
98 | "\xED" => 'ם', |
99 | "\xEE" => 'מ', |
100 | "\xEF" => 'ן', |
101 | "\xF0" => 'נ', |
102 | "\xF1" => 'ס', |
103 | "\xF2" => 'ע', |
104 | "\xF3" => 'ף', |
105 | "\xF4" => 'פ', |
106 | "\xF5" => 'ץ', |
107 | "\xF6" => 'צ', |
108 | "\xF7" => 'ק', |
109 | "\xF8" => 'ר', |
110 | "\xF9" => 'ש', |
111 | "\xFA" => 'ת', |
112 | "\xFD" => '‎', |
113 | "\xFE" => '‏' |
d672fcab |
114 | ); |
115 | |
116 | $string = str_replace(array_keys($iso8859_8), array_values($iso8859_8), $string); |
117 | |
118 | return $string; |
119 | } |
e53c9681 |
120 | ?> |