/usr/share/squirrelmail/functions/decode/cp1258.php is in squirrelmail 2:1.4.23~svn20120406-2ubuntu1.
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 | <?php
/**
* decode/cp1258.php
*
* This file contains cp1258 decoding function that is needed to read
* cp1258 encoded mails in non-cp1258 locale.
*
* Original data taken from:
* ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1258.TXT
*
* Name: cp1258 to Unicode table
* Unicode version: 2.0
* Table version: 2.01
* Table format: Format A
* Date: 04/15/98
* Contact: cpxlate@microsoft.com
*
* @copyright 2003-2012 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: cp1258.php 14248 2012-01-02 00:18:17Z pdontthink $
* @package squirrelmail
* @subpackage decode
*/
/**
* Decde a cp1258-encoded string
* @param string $string Encoded string
* @return string $string Decoded string
*/
function charset_decode_cp1258 ($string) {
// don't do decoding when there are no 8bit symbols
if (! sq_is8bit($string,'windows-1258'))
return $string;
$cp1258 = 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($cp1258), array_values($cp1258), $string);
return $string;
}
|