php.net |  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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nobs at nobswolf dot info
New email:
PHP Version: OS:

 

 [2008-09-09 12:09 UTC] nobs at nobswolf dot info
Description:
------------
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-31 00:29 UTC] cmb@php.net
-Package: Feature/Change Request +Package: Strings related
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC