php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27691 htmlentities breaks entities it already encoded
Submitted: 2004-03-25 03:25 UTC Modified: 2004-03-25 09:43 UTC
From: public at christopheringram dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.3.4 OS: Linux
Private report: No CVE-ID: None
 [2004-03-25 03:25 UTC] 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:
----------------
私はガラスを食べられます。それは私を傷つけません。


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-25 03:26 UTC] public at christopheringram dot com
Sorry, what is in Expected result: should be the actual result.
 [2004-03-25 09:43 UTC] derick@php.net
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


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 09:01:28 2024 UTC