Lines Matching refs:convmap
15 function test($desc, $str, $expected, $convmap, $encoding) {
16 $result = mb_decode_numericentity($str, $convmap, $encoding);
24 function testNonAscii($desc, $str, $expected, $convmap, $encoding) {
25 $result = mb_decode_numericentity($str, $convmap, $encoding);
37 // Typical convmap, typical numeric entity-encoded string
38 $convmap = array(0x0, 0x2FFFF, 0, 0xFFFF);
39 echo "1: " . mb_decode_numericentity($str1, $convmap, "UTF-8") . "\n";
40 echo "2: " . mb_decode_numericentity($str2, $convmap, "UTF-8") . "\n";
41 echo "3: " . mb_decode_numericentity($str3, $convmap, "UTF-8") . "\n";
44 echo "4: " . mb_decode_numericentity('�', $convmap), "\n"; // Entity is too big
45 echo "5: " . mb_decode_numericentity('�', $convmap), "\n"; // Entity is too big
46 echo "6: " . mb_decode_numericentity('�', $convmap), "\n"; // Too many digits
47 echo "7: " . mb_decode_numericentity('�', $convmap), "\n"; // Too many digits
48 echo "8: " . mb_decode_numericentity('�', $convmap), "\n"; // Too many digits
49 echo "9: " . mb_decode_numericentity('�', $convmap), "\n"; // Too many digits
50 echo "10: " . bin2hex(mb_decode_numericentity('�', $convmap)), "\n"; // OK
51 echo "11: " . bin2hex(mb_decode_numericentity('�', $convmap)), "\n"; // OK
53 echo "11b: " . bin2hex(mb_decode_numericentity('�', $convmap)), "\n"; // OK
54 echo "11c: " . bin2hex(mb_decode_numericentity('�', $convmap)), "\n"; // OK
55 echo "11d: " . bin2hex(mb_decode_numericentity('𐀀', $convmap)), "\n"; // OK
56 echo "11e: " . mb_decode_numericentity('�', $convmap), "\n"; // Too many digits
61 $convmap = [];
62 echo "13: " . mb_decode_numericentity('föo', $convmap, "UTF-8") . "\n";
67 // Weird convmap
68 $convmap = [
72 echo "17: " . mb_decode_numericentity('föo', $convmap, "UTF-8") . "\n";
75 $convmap = [0, 10, 1000, 0xFFFF];
76 echo "18: " . bin2hex(mb_decode_numericentity("ϩϪϫ", $convmap, "UTF-8")) . "\n";
77 echo "19: " . bin2hex(mb_decode_numericentity("ϩϪϫ", $convmap, "UTF-8")) . "\n";
113 $convmap = [0, 0xFFFF, 0, 0xFFFF];
117 if (mb_decode_numericentity($padding . "&#ZZZ", $convmap, 'UTF-8') !== $padding . "&#ZZZ")
119 if (mb_decode_numericentity($padding . "&#xZZZ", $convmap, 'UTF-8') !== $padding . "&#xZZZ")
122 if (mb_decode_numericentity($padding . "A", $convmap, 'UTF-8') !== $padding . "A")
124 if (mb_decode_numericentity($padding . "A", $convmap, 'UTF-8') !== $padding . "A")
131 if (mb_decode_numericentity($str, $convmap, 'UTF-8') !== $str)
135 if (mb_decode_numericentity($str, $convmap, 'UTF-8') !== $str)