2002-12-12 21:42:17 +00:00
|
|
|
--TEST--
|
|
|
|
Bug #20934 (htmlspecialchars returns latin1 from UTF-8)
|
|
|
|
--SKIPIF--
|
|
|
|
<?php
|
|
|
|
if (!function_exists("utf8_encode") || !function_exists("utf8_decode")) {
|
2002-12-12 21:44:53 +00:00
|
|
|
die("SKIP Neither utf8_encode() nor utf8_decode() are available");
|
2002-12-12 21:42:17 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
$str = utf8_encode("\xe0\xe1");
|
2007-03-06 20:45:15 +00:00
|
|
|
var_dump(bin2hex((binary)utf8_decode($str)));
|
|
|
|
var_dump(bin2hex((binary)utf8_decode(htmlspecialchars($str, ENT_COMPAT, "UTF-8"))));
|
2002-12-12 21:42:17 +00:00
|
|
|
?>
|
|
|
|
--EXPECT--
|
2007-03-06 20:45:15 +00:00
|
|
|
string(4) "e0e1"
|
|
|
|
string(4) "e0e1"
|
|
|
|
--UEXPECT--
|
|
|
|
unicode(4) "e0e1"
|
|
|
|
unicode(4) "e0e1"
|