#49861 [Opn->Csd]: htmlspecialchars() returns incorrect results for Unicode characters outside BMP
ID: 49861
Updated by: moriyoshi@php.net
Reported By: moriyoshi@php.net
-Status: Open
+Status: Closed
Bug Type: Strings related
Operating System: *
-PHP Version: 5.3SVN-2009-10-13 (SVN)
+PHP Version: 5.3.0
New Comment:
Just a reminder: this was already fixed along with bug #49785 in SVN.
Previous Comments:
------------------------------------------------------------------------
[2009-10-13 09:00:42] moriyoshi@php.net
Description:
------------
htmlspecialchars() / htmlentities() returns incorrect results when an
Unicode character whose codepoint is outside the range of BMP.
Confirmed with 5.3.0, 5.3SVN.
Reproduce code:
---------------
<?php
// U+1003C
var_dump(bin2hex(htmlspecialchars("\xf0\x90\x80\xbc", ENT_QUOTES,
'UTF-8'));
?>
Expected result:
----------------
string(8) "f09080bc"
Actual result:
--------------
string(8) "266c743b"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49861&edit=1
Thread (2 messages)