6 * Copyright (c) 2003 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
9 * This file contains cp1255 decoding function that is needed to read
10 * cp1255 encoded mails in non-cp1255 locale.
12 * Original data taken from:
13 * ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT
15 * Name: cp1255 to Unicode table
16 * Unicode version: 2.0
18 * Table format: Format A
20 * Contact: cpxlate@microsoft.com
24 function charset_decode_cp1255 ($string) {
25 global $default_charset;
27 if (strtolower($default_charset) == 'windows-1255')
30 /* Only do the slow convert if there are 8-bit characters */
31 /* avoid using 0xA0 (\240) in ereg ranges. RH73 does not like that */
32 if (! ereg("[\200-\237]", $string) and ! ereg("[\241-\377]", $string) )
110 "\xCA" => '�',
125 "\xD9" => '�',
126 "\xDA" => '�',
127 "\xDB" => '�',
128 "\xDC" => '�',
129 "\xDD" => '�',
130 "\xDE" => '�',
131 "\xDF" => '�',
159 "\xFB" => '�',
160 "\xFC" => '�',
166 $string = str_replace(array_keys($cp1255), array_values($cp1255), $string);