1--TEST-- 2Test mb_decode_numericentity() function : Convert HTML-Entities to UTF-8 3--SKIPIF-- 4<?php 5if (!extension_loaded('mbstring')) die('skip mbstring not enabled'); 6function_exists('mb_encode_mimeheader') or die("skip mb_encode_mimeheader() is not available in this build"); 7?> 8--FILE-- 9<?php 10$str1 = '¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'; 11$str2 = 'ƒΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρςστυφχψωϑϒϖ•…′″‾⁄℘ℑℜ™ℵ←↑→↓↔↵⇐⇑⇒⇓⇔∀∂∃∅∇∈∉∋∏∑−∗√∝∞∠∧∨∩∪∫∴∼≅≈≠≡≤≥⊂⊃⊄⊆⊇⊕⊗⊥⋅⌈⌉⌊⌋〈〉◊♠♣♥♦'; 12$str3 = 'aŒbœcŠdše€fg'; 13$convmap = array(0x0, 0x2FFFF, 0, 0xFFFF); 14echo mb_decode_numericentity($str1, $convmap, "UTF-8")."\n"; 15echo mb_decode_numericentity($str2, $convmap, "UTF-8")."\n"; 16echo mb_decode_numericentity($str3, $convmap, "UTF-8")."\n"; 17 18echo mb_decode_numericentity('�', $convmap), "\n"; 19echo mb_decode_numericentity('�', $convmap), "\n"; 20echo mb_decode_numericentity('�', $convmap), "\n"; 21echo mb_decode_numericentity('�', $convmap), "\n"; 22 23echo mb_decode_numericentity('�', $convmap), "\n"; 24echo mb_decode_numericentity('�', $convmap), "\n"; 25echo mb_decode_numericentity('�', $convmap), "\n"; 26echo mb_decode_numericentity('�', $convmap), "\n"; 27 28$convmap = []; 29echo mb_decode_numericentity('föo', $convmap, "UTF-8")."\n"; 30 31$convmap = array(0x0, 0x2FFFF, 0); // 3 elements 32try { 33 echo mb_decode_numericentity($str3, $convmap, "UTF-8")."\n"; 34} catch (ValueError $ex) { 35 echo $ex->getMessage()."\n"; 36} 37 38?> 39--EXPECT-- 40¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ 41ƒΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρςστυφχψωϑϒϖ•…′″‾⁄℘ℑℜ™ℵ←↑→↓↔↵⇐⇑⇒⇓⇔∀∂∃∅∇∈∉∋∏∑−∗√∝∞∠∧∨∩∪∫∴∼≅≈≠≡≤≥⊂⊃⊄⊆⊇⊕⊗⊥⋅⌈⌉⌊⌋〈〉◊♠♣♥♦ 42aŒbœcŠdše€fg 43� 44� 45� 46� 47� 48� 49� 50� 51föo 52mb_decode_numericentity(): Argument #2 ($map) must have a multiple of 4 elements 53