2e288c4efad8c084e63bec9434c4ed6a90fe90d5
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 cp10007 (MacCyrillic) decoding function that
10 * is needed to read cp10007 encoded mails in non-cp10007 locale.
12 * Original data taken from:
13 * ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/MAC/CYRILLIC.TXT
15 * Name: cp10007_MacCyrillic to Unicode table
16 * Unicode version: 2.0
18 * Table format: Format A
20 * Authors: Lori Brownell <loribr@microsoft.com>
21 * K.D. Chang <a-kchang@microsoft.com>
25 function charset_decode_cp10007 ($string) {
26 global $default_charset;
28 if (strtolower($default_charset) == 'x-mac-cyrillic')
31 /* Only do the slow convert if there are 8-bit characters */
32 /* avoid using 0xA0 (\240) in ereg ranges. RH73 does not like that */
33 if (! ereg("[\200-\237]", $string) and ! ereg("[\241-\377]", $string) )
167 $string = str_replace(array_keys($cp10007), array_values($cp10007), $string);