mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
Moves the usage of `mb_internal_encoding()` to INI section for the tests not testing the encoding/function itself, but the other mbstring/iconv functions.
26 lines
729 B
PHP
26 lines
729 B
PHP
--TEST--
|
|
Bug #65045: mb_convert_encoding breaks well-formed character
|
|
--EXTENSIONS--
|
|
mbstring
|
|
--INI--
|
|
internal_encoding=UTF-8
|
|
--FILE--
|
|
<?php
|
|
|
|
$str = "\xF0\xA4\xAD". "\xF0\xA4\xAD\xA2"."\xF0\xA4\xAD\xA2";
|
|
$str2 = "\xF0\xA4\xAD\xA2"."\xF0\xA4\xAD\xA2"."\xF0\xA4\xAD";
|
|
|
|
mb_substitute_character(0xFFFD);
|
|
|
|
echo bin2hex(htmlspecialchars_decode(htmlspecialchars($str, ENT_SUBSTITUTE, 'UTF-8'))), "\n";
|
|
echo bin2hex(htmlspecialchars_decode(htmlspecialchars($str2, ENT_SUBSTITUTE, 'UTF-8'))), "\n";
|
|
echo bin2hex(mb_convert_encoding($str, 'UTF-8', 'UTF-8')), "\n";
|
|
echo bin2hex(mb_convert_encoding($str2, 'UTF-8', 'UTF-8')), "\n";
|
|
|
|
?>
|
|
--EXPECT--
|
|
efbfbdf0a4ada2f0a4ada2
|
|
f0a4ada2f0a4ada2efbfbd
|
|
efbfbdf0a4ada2f0a4ada2
|
|
f0a4ada2f0a4ada2efbfbd
|