|  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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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: Thu Apr 25 15:01:30 2024 UTC