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 cp855 decoding function that is needed to read
10 * cp855 encoded mails in non-cp855 locale.
12 * Original data taken from:
13 * ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP855.TXT
14 * Name: cp855_DOSCyrillic to Unicode table
15 * Unicode version: 2.0
17 * Table format: Format A
19 * Authors: Lori Brownell <loribr@microsoft.com>
20 * K.D. Chang <a-kchang@microsoft.com>
23 function charset_decode_cp855 ($string) {
24 global $default_charset;
26 if (strtolower($default_charset) == 'ibm855')
29 /* Only do the slow convert if there are 8-bit characters */
30 /* avoid using 0xA0 (\240) in ereg ranges. RH73 does not like that */
31 if (! ereg("[\200-\237]", $string) and ! ereg("[\241-\377]", $string) )
165 $string = str_replace(array_keys($cp855), array_values($cp855), $string);