1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 03:03:26 +02:00

Add tests for UCS-2 text encoding

This commit is contained in:
Alex Dowad
2021-08-24 21:23:26 +02:00
parent 34ef8f3ca2
commit 79015b23aa
+11
View File
@@ -20,6 +20,13 @@ echo "7bit done\n";
var_dump(mb_convert_encoding("\x01\x00", "8bit", "UTF-16BE")); // codepoints over 0xFF are illegal for '8-bit'
echo "8bit done\n";
// UCS-2
echo bin2hex(mb_convert_encoding("\xFF\xFE\x00\x30", "UTF-16BE", "UCS-2")), "\n";
echo bin2hex(mb_convert_encoding("\xFE\xFF\x30\x00", "UTF-16BE", "UCS-2")), "\n";
echo bin2hex(mb_convert_encoding("\x00\x30", "UTF-16BE", "UCS-2LE")), "\n";
echo "UCS-2 done\n";
?>
--EXPECT--
string(3) "ABC"
@@ -28,3 +35,7 @@ string(3) "ABC"
7bit done
string(1) "%"
8bit done
3000
3000
3000
UCS-2 done