mirror of
https://github.com/php/php-src.git
synced 2025-01-14 06:54:52 +08:00
22 lines
2.5 KiB
PHP
22 lines
2.5 KiB
PHP
--TEST--
|
|
Test mb_decode_numericentity() function : Convert HTML-Entities to UTF-8
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('mbstring')) die('skip mbstring not enabled');
|
|
function_exists('mb_encode_mimeheader') or die("skip mb_encode_mimeheader() is not available in this build");
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
$str1 = '¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ';
|
|
$str2 = 'ƒΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρςστυφχψωϑϒϖ•…′″‾⁄℘ℑℜ™ℵ←↑→↓↔↵⇐⇑⇒⇓⇔∀∂∃∅∇∈∉∋∏∑−∗√∝∞∠∧∨∩∪∫∴∼≅≈≠≡≤≥⊂⊃⊄⊆⊇⊕⊗⊥⋅⌈⌉⌊⌋〈〉◊♠♣♥♦';
|
|
$str3 = 'aŒbœcŠdše€fg';
|
|
$convmap = array(0x0, 0x2FFFF, 0, 0xFFFF);
|
|
echo mb_decode_numericentity($str1, $convmap, "UTF-8")."\n";
|
|
echo mb_decode_numericentity($str2, $convmap, "UTF-8")."\n";
|
|
echo mb_decode_numericentity($str3, $convmap, "UTF-8")."\n";
|
|
?>
|
|
--EXPECT--
|
|
¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
|
|
ƒΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρςστυφχψωϑϒϖ•…′″‾⁄℘ℑℜ™ℵ←↑→↓↔↵⇐⇑⇒⇓⇔∀∂∃∅∇∈∉∋∏∑−∗√∝∞∠∧∨∩∪∫∴∼≅≈≠≡≤≥⊂⊃⊄⊆⊇⊕⊗⊥⋅⌈⌉⌊⌋〈〉◊♠♣♥♦
|
|
aŒbœcŠdše€fg
|