#27691 [Opn->Bgs]: htmlentities breaks entities it already encoded

From: Date: Thu, 25 Mar 2004 14:43:15 +0000
Subject: #27691 [Opn->Bgs]: htmlentities breaks entities it already encoded
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-56815@lists.php.net to get a copy of this message
ID: 27691 Updated by: derick@php.net Reported By: public at christopheringram dot com -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: Linux PHP Version: 4.3.4 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Previous Comments: ------------------------------------------------------------------------ [2004-03-25 03:26:40] public at christopheringram dot com Sorry, what is in Expected result: should be the actual result. ------------------------------------------------------------------------ [2004-03-25 03:25:41] public at christopheringram dot com Description: ------------ When using htmlentities() on data that has high position characters ( >127), the characters are translated into &#nnnn; where nnnn is the character code. It seems the characters are translated properly to &#nnnn;, and then the ampersand is translated into &, making the translation of non ASCII characters pointless. Reproduce code: --------------- echo htmlentities("私はガラスを食べられます。それは私を傷つけません", ENT_QUOTES,'UTF-8'); Expected result: ---------------- 私はガラスを食べられます。それは私を傷つけません。 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27691&edit=1

« previous php.bugs (#56815) next »