|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
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-2023 The PHP Group
All rights reserved.
Last updated: Tue Mar 28 22:03:42 2023 UTC