1d443fe2f64d95a042e87c97d53fc63b44ed0e80
5 * Copyright (c) 2003-2004 The SquirrelMail Project Team
6 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 * This file contains cp1255 decoding function that is needed to read
9 * cp1255 encoded mails in non-cp1255 locale.
11 * Original data taken from:
12 * ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT
14 * Name: cp1255 to Unicode table
15 * Unicode version: 2.0
17 * Table format: Format A
19 * Contact: cpxlate@microsoft.com
22 * @package squirrelmail
27 * Decode cp1255-encoded string
28 * @param string $string Encoded string
29 * @return string $string decoded string
31 function charset_decode_cp1255 ($string) {
32 global $default_charset;
34 if (strtolower($default_charset) == 'windows-1255')
37 // don't do decoding when there are no 8bit symbols
38 if (! sq_is8bit($string,'windows-1255'))
116 "\xCA" => '�',
131 "\xD9" => '�',
132 "\xDA" => '�',
133 "\xDB" => '�',
134 "\xDC" => '�',
135 "\xDD" => '�',
136 "\xDE" => '�',
137 "\xDF" => '�',
165 "\xFB" => '�',
166 "\xFC" => '�',
172 $string = str_replace(array_keys($cp1255), array_values($cp1255), $string);