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

From: Date: Thu, 25 Mar 2004 08:26:40 +0000
Subject: #27691 [Opn]: htmlentities breaks entities it already encoded
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-56796@lists.php.net to get a copy of this message
ID: 27691 User updated by: public at christopheringram dot com Reported By: public at christopheringram dot com Status: Open Bug Type: Unknown/Other Function Operating System: Linux PHP Version: 4.3.4 New Comment: Sorry, what is in Expected result: should be the actual result. Previous Comments: ------------------------------------------------------------------------ [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 (#56796) next »