|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
34 - 31 = ?
Subscribe to this entry?

 [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-2023 The PHP Group
All rights reserved.
Last updated: Tue Mar 28 21:03:37 2023 UTC