removed local directory name used for testing.
[squirrelmail.git] / functions / decode / iso_8859_7.php
CommitLineData
d672fcab 1<?php
d6c32258 2/**
d672fcab 3 * decode/iso8859-7.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-7 decoding function that is needed to read
9 * iso-8859-7 encoded mails in non-iso-8859-7 locale.
91e0dccc 10 *
d672fcab 11 * Original data taken from:
12 * ftp://ftp.unicode.org/Public/MAPPINGS/ISO8859/8859-7.TXT
13 *
14 * Name: ISO 8859-7:1987 to Unicode
15 * Unicode version: 3.0
16 * Table version: 1.0
17 * Table format: Format A
18 * Date: 1999 July 27
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-7 encoded strings
45 * @param string $string Encoded string
46 * @return string $string Decoded string
d672fcab 47 */
df8c4d6d 48function charset_decode_iso_8859_7 ($string) {
e53c9681 49 // don't do decoding when there are no 8bit symbols
50 if (! sq_is8bit($string,'iso-8859-7'))
d672fcab 51 return $string;
52
53 $iso8859_7 = array(
e53c9681 54 "\xA0" => '&#160;',
55 "\xA1" => '&#8216;',
56 "\xA2" => '&#8217;',
57 "\xA3" => '&#163;',
58 "\xA6" => '&#166;',
59 "\xA7" => '&#167;',
60 "\xA8" => '&#168;',
61 "\xA9" => '&#169;',
62 "\xAB" => '&#171;',
63 "\xAC" => '&#172;',
64 "\xAD" => '&#173;',
65 "\xAF" => '&#8213;',
66 "\xB0" => '&#176;',
67 "\xB1" => '&#177;',
68 "\xB2" => '&#178;',
69 "\xB3" => '&#179;',
70 "\xB4" => '&#900;',
71 "\xB5" => '&#901;',
72 "\xB6" => '&#902;',
73 "\xB7" => '&#183;',
74 "\xB8" => '&#904;',
75 "\xB9" => '&#905;',
76 "\xBA" => '&#906;',
77 "\xBB" => '&#187;',
78 "\xBC" => '&#908;',
79 "\xBD" => '&#189;',
80 "\xBE" => '&#910;',
81 "\xBF" => '&#911;',
82 "\xC0" => '&#912;',
83 "\xC1" => '&#913;',
84 "\xC2" => '&#914;',
85 "\xC3" => '&#915;',
86 "\xC4" => '&#916;',
87 "\xC5" => '&#917;',
88 "\xC6" => '&#918;',
89 "\xC7" => '&#919;',
90 "\xC8" => '&#920;',
91 "\xC9" => '&#921;',
92 "\xCA" => '&#922;',
93 "\xCB" => '&#923;',
94 "\xCC" => '&#924;',
95 "\xCD" => '&#925;',
96 "\xCE" => '&#926;',
97 "\xCF" => '&#927;',
98 "\xD0" => '&#928;',
99 "\xD1" => '&#929;',
100 "\xD3" => '&#931;',
101 "\xD4" => '&#932;',
102 "\xD5" => '&#933;',
103 "\xD6" => '&#934;',
104 "\xD7" => '&#935;',
105 "\xD8" => '&#936;',
106 "\xD9" => '&#937;',
107 "\xDA" => '&#938;',
108 "\xDB" => '&#939;',
109 "\xDC" => '&#940;',
110 "\xDD" => '&#941;',
111 "\xDE" => '&#942;',
112 "\xDF" => '&#943;',
113 "\xE0" => '&#944;',
114 "\xE1" => '&#945;',
115 "\xE2" => '&#946;',
116 "\xE3" => '&#947;',
117 "\xE4" => '&#948;',
118 "\xE5" => '&#949;',
119 "\xE6" => '&#950;',
120 "\xE7" => '&#951;',
121 "\xE8" => '&#952;',
122 "\xE9" => '&#953;',
123 "\xEA" => '&#954;',
124 "\xEB" => '&#955;',
125 "\xEC" => '&#956;',
126 "\xED" => '&#957;',
127 "\xEE" => '&#958;',
128 "\xEF" => '&#959;',
129 "\xF0" => '&#960;',
130 "\xF1" => '&#961;',
131 "\xF2" => '&#962;',
132 "\xF3" => '&#963;',
133 "\xF4" => '&#964;',
134 "\xF5" => '&#965;',
135 "\xF6" => '&#966;',
136 "\xF7" => '&#967;',
137 "\xF8" => '&#968;',
138 "\xF9" => '&#969;',
139 "\xFA" => '&#970;',
140 "\xFB" => '&#971;',
141 "\xFC" => '&#972;',
142 "\xFD" => '&#973;',
143 "\xFE" => '&#974;'
d672fcab 144 );
145
146 $string = str_replace(array_keys($iso8859_7), array_values($iso8859_7), $string);
147
148 return $string;
149}
e53c9681 150?>