|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #46028 improve htmlentities to encode really every code
Submitted: 2008-09-09 12:09 UTC Modified: 2016-12-31 00:29 UTC
From: nobs at nobswolf dot info Assigned:
Status: Open Package: Strings related
PHP Version: 5.2.6 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: nobs at nobswolf dot info
New email:
PHP Version: OS:


 [2008-09-09 12:09 UTC] nobs at nobswolf dot info
Please give htmlentities an option to encode all codes that are not ASCII even if numerical encoding is needed.

Maybe the option could be a "accepted base encoding" like:

string htmlentities  ( string $string  [, int $quote_style  [, string $charset  [, bool $double_encode  [, string $base_charset  ]]]] )

Reproduce code:
Having a generated page that needs to stay in latin-1 encoding because it is part of a bigger project, you want to include some dynamic content in cyrilic (e.g. from user input encoded in UTF-8).

Expected result:
encode all non-ASCII and non-character-entity-characters as something like Ӓ

Actual result:
they left untouched which gives encoding errors


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-31 00:29 UTC]
-Package: Feature/Change Request +Package: Strings related
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Mar 02 05:01:28 2024 UTC