/usr/share/squirrelmail/functions/decode/cp874.php is in squirrelmail-decode 1.2-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | <?php
/**
* decode/cp874.php
*
* Copyright (c) 2005 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* This file contains cp874 decoding function that is needed to read
* cp874 encoded mails in non-cp874 locale.
*
* Original data taken from:
* ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/
*
* Name: cp874 to Unicode table
* Unicode version: 2.0
* Table version: 2.01
* Table format: Format A
* Date: 02/28/98
*
* Contact: cpxlate@microsoft.com
*
* @version $Id: cp874.php 12467 2007-06-25 15:52:44Z kink $
* @package decode
* @subpackage eastasia
*/
/**
* Decode a cp874-encoded string
* @param string $string Encoded string
* @return string $string Decoded string
*/
function charset_decode_cp874 ($string) {
// don't do decoding when there are no 8bit symbols
if (! sq_is8bit($string,'cp874'))
return $string;
$cp874 = array(
"\x80" => '€',
"\x81" => '?',
"\x82" => '?',
"\x83" => '?',
"\x84" => '?',
"\x85" => '…',
"\x86" => '?',
"\x87" => '?',
"\x88" => '?',
"\x89" => '?',
"\x8A" => '?',
"\x8B" => '?',
"\x8C" => '?',
"\x8D" => '?',
"\x8E" => '?',
"\x8F" => '?',
"\x90" => '?',
"\x91" => '‘',
"\x92" => '’',
"\x93" => '“',
"\x94" => '”',
"\x95" => '•',
"\x96" => '–',
"\x97" => '—',
"\x98" => '?',
"\x99" => '?',
"\x9A" => '?',
"\x9B" => '?',
"\x9C" => '?',
"\x9D" => '?',
"\x9E" => '?',
"\x9F" => '?',
"\xA0" => ' ',
"\xA1" => 'ก',
"\xA2" => 'ข',
"\xA3" => 'ฃ',
"\xA4" => 'ค',
"\xA5" => 'ฅ',
"\xA6" => 'ฆ',
"\xA7" => 'ง',
"\xA8" => 'จ',
"\xA9" => 'ฉ',
"\xAA" => 'ช',
"\xAB" => 'ซ',
"\xAC" => 'ฌ',
"\xAD" => 'ญ',
"\xAE" => 'ฎ',
"\xAF" => 'ฏ',
"\xB0" => 'ฐ',
"\xB1" => 'ฑ',
"\xB2" => 'ฒ',
"\xB3" => 'ณ',
"\xB4" => 'ด',
"\xB5" => 'ต',
"\xB6" => 'ถ',
"\xB7" => 'ท',
"\xB8" => 'ธ',
"\xB9" => 'น',
"\xBA" => 'บ',
"\xBB" => 'ป',
"\xBC" => 'ผ',
"\xBD" => 'ฝ',
"\xBE" => 'พ',
"\xBF" => 'ฟ',
"\xC0" => 'ภ',
"\xC1" => 'ม',
"\xC2" => 'ย',
"\xC3" => 'ร',
"\xC4" => 'ฤ',
"\xC5" => 'ล',
"\xC6" => 'ฦ',
"\xC7" => 'ว',
"\xC8" => 'ศ',
"\xC9" => 'ษ',
"\xCA" => 'ส',
"\xCB" => 'ห',
"\xCC" => 'ฬ',
"\xCD" => 'อ',
"\xCE" => 'ฮ',
"\xCF" => 'ฯ',
"\xD0" => 'ะ',
"\xD1" => 'ั',
"\xD2" => 'า',
"\xD3" => 'ำ',
"\xD4" => 'ิ',
"\xD5" => 'ี',
"\xD6" => 'ึ',
"\xD7" => 'ื',
"\xD8" => 'ุ',
"\xD9" => 'ู',
"\xDA" => 'ฺ',
"\xDB" => '?',
"\xDC" => '?',
"\xDD" => '?',
"\xDE" => '?',
"\xDF" => '฿',
"\xE0" => 'เ',
"\xE1" => 'แ',
"\xE2" => 'โ',
"\xE3" => 'ใ',
"\xE4" => 'ไ',
"\xE5" => 'ๅ',
"\xE6" => 'ๆ',
"\xE7" => '็',
"\xE8" => '่',
"\xE9" => '้',
"\xEA" => '๊',
"\xEB" => '๋',
"\xEC" => '์',
"\xED" => 'ํ',
"\xEE" => '๎',
"\xEF" => '๏',
"\xF0" => '๐',
"\xF1" => '๑',
"\xF2" => '๒',
"\xF3" => '๓',
"\xF4" => '๔',
"\xF5" => '๕',
"\xF6" => '๖',
"\xF7" => '๗',
"\xF8" => '๘',
"\xF9" => '๙',
"\xFA" => '๚',
"\xFB" => '๛',
"\xFC" => '?',
"\xFD" => '?',
"\xFE" => '?',
"\xFF" => '?'
);
$string = str_replace(array_keys($cp874), array_values($cp874), $string);
return $string;
}
|