1--TEST-- 2Translation of HTML entities for encoding WIN-1252 3--FILE-- 4<?php 5$arr = array( 60x20AC => array(0x80, "EURO SIGN"), 7//0x81 #UNDEFINED 80x201A => array(0x82, "SINGLE LOW-9 QUOTATION MARK"), 90x0192 => array(0x83, "LATIN SMALL LETTER F WITH HOOK"), 100x201E => array(0x84, "DOUBLE LOW-9 QUOTATION MARK"), 110x2026 => array(0x85, "HORIZONTAL ELLIPSIS"), 120x2020 => array(0x86, "DAGGER"), 130x2021 => array(0x87, "DOUBLE DAGGER"), 140x02C6 => array(0x88, "MODIFIER LETTER CIRCUMFLEX ACCENT"), 150x2030 => array(0x89, "PER MILLE SIGN"), 160x0160 => array(0x8A, "LATIN CAPITAL LETTER S WITH CARON"), 170x2039 => array(0x8B, "SINGLE LEFT-POINTING ANGLE QUOTATION MARK"), 180x0152 => array(0x8C, "LATIN CAPITAL LIGATURE OE"), 19//0x8D #UNDEFINED 200x017D => array(0x8E, "LATIN CAPITAL LETTER Z WITH CARON"), 21//0x8F #UNDEFINED 22//0x90 #UNDEFINED 230x2018 => array(0x91, "LEFT SINGLE QUOTATION MARK"), 240x2019 => array(0x92, "RIGHT SINGLE QUOTATION MARK"), 250x201C => array(0x93, "LEFT DOUBLE QUOTATION MARK"), 260x201D => array(0x94, "RIGHT DOUBLE QUOTATION MARK"), 270x2022 => array(0x95, "BULLET"), 280x2013 => array(0x96, "EN DASH"), 290x2014 => array(0x97, "EM DASH"), 300x02DC => array(0x98, "SMALL TILDE"), 310x2122 => array(0x99, "TRADE MARK SIGN"), 320x0161 => array(0x9A, "LATIN SMALL LETTER S WITH CARON"), 330x203A => array(0x9B, "SINGLE RIGHT-POINTING ANGLE QUOTATION MARK"), 340x0153 => array(0x9C, "LATIN SMALL LIGATURE OE"), 35//0x9D #UNDEFINED 360x017E => array(0x9E, "LATIN SMALL LETTER Z WITH CARON"), 370x0178 => array(0x9F, "LATIN CAPITAL LETTER Y WITH DIAERESIS"), 38); 39 40$res = html_entity_decode("", ENT_QUOTES, 'WINDOWS-1252'); 41echo "Special test for  (shouldn't decode):\n"; 42echo $res,"\n\n"; 43 44$res = html_entity_decode("", ENT_QUOTES, 'WINDOWS-1252'); 45echo "Special test for  (shouldn't decode):\n"; 46echo $res,"\n\n"; 47 48$res = html_entity_decode("", ENT_QUOTES, 'WINDOWS-1252'); 49echo "Special test for  (shouldn't decode):\n"; 50echo $res,"\n\n"; 51 52$res = html_entity_decode("", ENT_QUOTES, 'WINDOWS-1252'); 53echo "Special test for  (shouldn't decode):\n"; 54echo $res,"\n\n"; 55 56$res = html_entity_decode("", ENT_QUOTES, 'WINDOWS-1252'); 57echo "Special test for  (shouldn't decode):\n"; 58echo $res,"\n\n"; 59 60foreach ($arr as $u => $v) { 61 $ent = sprintf("&#x%X;", $u); 62 $res = html_entity_decode($ent, ENT_QUOTES, 'WINDOWS-1252'); 63 $d = unpack("H*", $res); 64 echo sprintf("%s: %s => %s\n", $v[1], $ent, $d[1]); 65 66 $ent = sprintf("&#x%X;", $v[0]); 67 $res = html_entity_decode($ent, ENT_QUOTES, 'WINDOWS-1252'); 68 if ($res[0] != "&" || $res[1] != "#") 69 $res = unpack("H*", $res)[1]; 70 echo sprintf("%s => %s\n\n", $ent, $res); 71} 72--EXPECT-- 73Special test for  (shouldn't decode): 74 75 76Special test for  (shouldn't decode): 77 78 79Special test for  (shouldn't decode): 80 81 82Special test for  (shouldn't decode): 83 84 85Special test for  (shouldn't decode): 86 87 88EURO SIGN: € => 80 89€ => € 90 91SINGLE LOW-9 QUOTATION MARK: ‚ => 82 92‚ => ‚ 93 94LATIN SMALL LETTER F WITH HOOK: ƒ => 83 95ƒ => ƒ 96 97DOUBLE LOW-9 QUOTATION MARK: „ => 84 98„ => „ 99 100HORIZONTAL ELLIPSIS: … => 85 101… => … 102 103DAGGER: † => 86 104† => † 105 106DOUBLE DAGGER: ‡ => 87 107‡ => ‡ 108 109MODIFIER LETTER CIRCUMFLEX ACCENT: ˆ => 88 110ˆ => ˆ 111 112PER MILLE SIGN: ‰ => 89 113‰ => ‰ 114 115LATIN CAPITAL LETTER S WITH CARON: Š => 8a 116Š => Š 117 118SINGLE LEFT-POINTING ANGLE QUOTATION MARK: ‹ => 8b 119‹ => ‹ 120 121LATIN CAPITAL LIGATURE OE: Œ => 8c 122Œ => Œ 123 124LATIN CAPITAL LETTER Z WITH CARON: Ž => 8e 125Ž => Ž 126 127LEFT SINGLE QUOTATION MARK: ‘ => 91 128‘ => ‘ 129 130RIGHT SINGLE QUOTATION MARK: ’ => 92 131’ => ’ 132 133LEFT DOUBLE QUOTATION MARK: “ => 93 134“ => “ 135 136RIGHT DOUBLE QUOTATION MARK: ” => 94 137” => ” 138 139BULLET: • => 95 140• => • 141 142EN DASH: – => 96 143– => – 144 145EM DASH: — => 97 146— => — 147 148SMALL TILDE: ˜ => 98 149˜ => ˜ 150 151TRADE MARK SIGN: ™ => 99 152™ => ™ 153 154LATIN SMALL LETTER S WITH CARON: š => 9a 155š => š 156 157SINGLE RIGHT-POINTING ANGLE QUOTATION MARK: › => 9b 158› => › 159 160LATIN SMALL LIGATURE OE: œ => 9c 161œ => œ 162 163LATIN SMALL LETTER Z WITH CARON: ž => 9e 164ž => ž 165 166LATIN CAPITAL LETTER Y WITH DIAERESIS: Ÿ => 9f 167Ÿ => Ÿ 168