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 cp10081 (MacTurkish) decoding function that
10 * is needed to read cp10081 encoded mails in non-cp10081 locale.
12 * Original data taken from:
13 * ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/MAC/TURKISH.TXT
15 * Name: cp10081_MacTurkish 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>
24 function charset_decode_cp10081 ($string) {
25 global $default_charset;
27 if (strtolower($default_charset) == 'x-mac-turkish')
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) )
103 "\0xC3" => '√',
105 "\0xC5" => '≈',
106 "\0xC6" => '∆',
109 "\0xC9" => '…',
116 "\0xD0" => '–',
117 "\0xD1" => '—',
118 "\0xD2" => '“',
119 "\0xD3" => '”',
120 "\0xD4" => '‘',
121 "\0xD5" => '’',
123 "\0xD7" => '◊',
132 "\0xE0" => '‡',
134 "\0xE2" => '‚',
135 "\0xE3" => '„',
136 "\0xE4" => '‰',
148 "\0xF0" => '',
153 "\0xF5" => '',
166 $string = str_replace(array_keys($cp10081), array_values($cp10081), $string);