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
| function convertUTF8toISOhex ($msg) {
$TabConvert = array("%" => "%25",
"!" => "%21",
"#" => "%23",
"$" => "%24",
"&" => "%26",
"'" => "%27",
"(" => "%28",
")" => "%29",
"*" => "%2A",
"+" => "%2B",
"," => "%2C",
"-" => "%2D",
"." => "%2E",
"/" => "%2F",
":" => "%3A",
";" => "%3B",
"<" => "%3C",
"=" => "%3D",
">" => "%3E",
"?" => "%3F",
"@" => "%40",
"[" => "%5B",
"]" => "%5D",
"^" => "%5E",
"_" => "%5F",
"`" => "%60",
"{" => "%7B",
"|" => "%7C",
"}" => "%7D",
"~" => "%7E",
"" => "%7F",
"" => "%80",
"" => "%82",
"" => "%83",
"" => "%84",
"
" => "%85",
"" => "%86",
"" => "%87",
"" => "%88",
"" => "%89",
"" => "%8A",
"" => "%8B",
"" => "%8C",
"" => "%8E",
"" => "%91",
"" => "%92",
"" => "%93",
"" => "%94",
"" => "%95",
"" => "%96",
"" => "%97",
"" => "%99",
"" => "%9A",
"" => "%9B",
"" => "%9C",
"" => "%9E",
"" => "%9F",
"¡" => "%A1",
"¢" => "%A2",
"£" => "%A3",
"¤" => "%A4",
"¥" => "%A5",
"¦" => "%A6",
"§" => "%A7",
"¨" => "%A8",
"©" => "%A9",
"ª" => "%AA",
"«" => "%AB",
"¬" => "%AC",
"*" => "%AD",
"®" => "%AE",
"¯" => "%AF",
"°" => "%B0",
"±" => "%B1",
"²" => "%B2",
"³" => "%B3",
"´" => "%B4",
"µ" => "%B5",
"¶" => "%B6",
"·" => "%B7",
"¸" => "%B8",
"¹" => "%B9",
"º" => "%BA",
"»" => "%BB",
"¼" => "%BC",
"½" => "%BD",
"¾" => "%BE",
"¿" => "%BF",
"À" => "%C0",
"Á" => "%C1",
"Â" => "%C2",
"Ã" => "%C3",
"Ä" => "%C4",
"Å" => "%C5",
"Æ" => "%C6",
"Ç" => "%C7",
"È" => "%C8",
"É" => "%C9",
"Ê" => "%CA",
"Ë" => "%CB",
"Ì" => "%CC",
"Í" => "%CD",
"Î" => "%CE",
"Ï" => "%CF",
"Ð" => "%D0",
"Ñ" => "%D1",
"Ò" => "%D2",
"Ó" => "%D3",
"Ô" => "%D4",
"Õ" => "%D5",
"Ö" => "%D6",
"×" => "%D7",
"Ø" => "%D8",
"Ù" => "%D9",
"Ú" => "%DA",
"Û" => "%DB",
"Ü" => "%DC",
"Ý" => "%DD",
"Þ" => "%DE",
"ß" => "%DF",
"à" => "%E0",
"á" => "%E1",
"â" => "%E2",
"ã" => "%E3",
"ä" => "%E4",
"å" => "%E5",
"æ" => "%E6",
"ç" => "%E7",
"è" => "%E8",
"é" => "%E9",
"ê" => "%EA",
"ë" => "%EB",
"ì" => "%EC",
"í" => "%ED",
"î" => "%EE",
"ï" => "%EF",
"ð" => "%F0",
"ñ" => "%F1",
"ò" => "%F2",
"ó" => "%F3",
"ô" => "%F4",
"õ" => "%F5",
"ö" => "%F6",
"÷" => "%F7",
"ø" => "%F8",
"ù" => "%F9",
"ú" => "%FA",
"û" => "%FB",
"ü" => "%FC",
"ý" => "%FD",
"þ" => "%FE",
"ÿ" => "%FF",
'\r' => '%0D',
'\n' => '%0A',
'\"' => '%22',
'\\' => '%5C');
$Tabkey = array_keys($TabConvert);
for($i = 0; $i < count($Tabkey);$i++){
$msg = str_replace($Tabkey[$i], $TabConvert[$Tabkey[$i]], $msg);
}
return $msg;
} |
Partager