ID: 45581 Updated by: [EMAIL PROTECTED] Reported By: funky2step at gmail dot com -Status: Open +Status: Verified Bug Type: Strings related Operating System: Red Hat Enterprise Linux ES PHP Version: 5.2.6 New Comment:
It's just that the function does not understand the hex entities. :) Previous Comments: ------------------------------------------------------------------------ [2008-07-21 14:21:11] funky2step at gmail dot com obviously that should have been $out = htmlspecialchars($str, ENT_COMPAT, 'UTF-8', FALSE); :) ------------------------------------------------------------------------ [2008-07-21 14:14:01] funky2step at gmail dot com Description: ------------ Trying to use htmlspecialchars() on a string containing &#xHEX; characters e.g. £ With double encode set to false, it still converts the & to & Reproduce code: --------------- $str = "£ one & two"; $out = htmlspecialchars($content, ENT_COMPAT, 'UTF-8', FALSE); echo $out; Expected result: ---------------- £ one & two Actual result: -------------- £ one & two ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45581&edit=1