mirror of
https://github.com/php/php-src.git
synced 2025-08-17 14:38:49 +02:00

There was one faulty test in the suite which only passed before because UTF-16 had no identify filter. After this was fixed, it exposed the problem with the test.
21 lines
508 B
PHP
21 lines
508 B
PHP
--TEST--
|
|
mb_convert_encoding() when encoding detection fails
|
|
--INI--
|
|
mbstring.strict_detection=1
|
|
--FILE--
|
|
<?php
|
|
|
|
var_dump(mb_convert_encoding("\xff", "ASCII", ["UTF-8", "UTF-16"]));
|
|
|
|
$str = "\xff";
|
|
var_dump(mb_convert_variables("ASCII", ["UTF-8", "UTF-16"], $str));
|
|
var_dump(bin2hex($str));
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Warning: mb_convert_encoding(): Unable to detect character encoding in %s on line %d
|
|
bool(false)
|
|
|
|
Warning: mb_convert_variables(): Unable to detect encoding in %s on line %d
|
|
bool(false)
|
|
string(2) "ff"
|