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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: public at christopheringram dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 19:01:28 2025 UTC