6 * This file contains cp866 decoding function that is needed to read
7 * cp866 encoded mails in non-cp866 locale.
9 * Original data taken from:
10 * ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/
12 Name: cp866_DOSCyrillicRussian to Unicode table
15 Table format: Format A
17 Authors: Lori Brownell <loribr@microsoft.com>
18 K.D. Chang <a-kchang@microsoft.com>
19 The entries are in cp866_DOSCyrillicRussian order
21 * @copyright © 2003-2006 The SquirrelMail Project Team
22 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
24 * @package squirrelmail
29 * Decode a cp866-encoded string
30 * @param string $string Encoded string
31 * @return string $string Decoded string
33 function charset_decode_cp866 ($string) {
34 // don't do decoding when there are no 8bit symbols
35 if (! sq_is8bit($string,'ibm866'))
169 $string = str_replace(array_keys($cp866), array_values($cp866), $string);