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?> 73--EXPECT-- 74Special test for  (shouldn't decode): 75 76 77Special test for  (shouldn't decode): 78 79 80Special test for  (shouldn't decode): 81 82 83Special test for  (shouldn't decode): 84 85 86Special test for  (shouldn't decode): 87 88 89EURO SIGN: € => 80 90€ => € 91 92SINGLE LOW-9 QUOTATION MARK: ‚ => 82 93‚ => ‚ 94 95LATIN SMALL LETTER F WITH HOOK: ƒ => 83 96ƒ => ƒ 97 98DOUBLE LOW-9 QUOTATION MARK: „ => 84 99„ => „ 100 101HORIZONTAL ELLIPSIS: … => 85 102… => … 103 104DAGGER: † => 86 105† => † 106 107DOUBLE DAGGER: ‡ => 87 108‡ => ‡ 109 110MODIFIER LETTER CIRCUMFLEX ACCENT: ˆ => 88 111ˆ => ˆ 112 113PER MILLE SIGN: ‰ => 89 114‰ => ‰ 115 116LATIN CAPITAL LETTER S WITH CARON: Š => 8a 117Š => Š 118 119SINGLE LEFT-POINTING ANGLE QUOTATION MARK: ‹ => 8b 120‹ => ‹ 121 122LATIN CAPITAL LIGATURE OE: Œ => 8c 123Œ => Œ 124 125LATIN CAPITAL LETTER Z WITH CARON: Ž => 8e 126Ž => Ž 127 128LEFT SINGLE QUOTATION MARK: ‘ => 91 129‘ => ‘ 130 131RIGHT SINGLE QUOTATION MARK: ’ => 92 132’ => ’ 133 134LEFT DOUBLE QUOTATION MARK: “ => 93 135“ => “ 136 137RIGHT DOUBLE QUOTATION MARK: ” => 94 138” => ” 139 140BULLET: • => 95 141• => • 142 143EN DASH: – => 96 144– => – 145 146EM DASH: — => 97 147— => — 148 149SMALL TILDE: ˜ => 98 150˜ => ˜ 151 152TRADE MARK SIGN: ™ => 99 153™ => ™ 154 155LATIN SMALL LETTER S WITH CARON: š => 9a 156š => š 157 158SINGLE RIGHT-POINTING ANGLE QUOTATION MARK: › => 9b 159› => › 160 161LATIN SMALL LIGATURE OE: œ => 9c 162œ => œ 163 164LATIN SMALL LETTER Z WITH CARON: ž => 9e 165ž => ž 166 167LATIN CAPITAL LETTER Y WITH DIAERESIS: Ÿ => 9f 168Ÿ => Ÿ 169