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