|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #7923 htmlentities doesn't work for ISO 8859-2
Submitted: 2000-11-22 08:17 UTC Modified: 2011-09-16 21:08 UTC
Avg. Score:4.5 ± 0.8
Reproduced:17 of 17 (100.0%)
Same Version:5 (29.4%)
Same OS:7 (41.2%)
From: muhlig at us dot edu dot pl Assigned: tyrael (profile)
Status: Closed Package: Strings related
PHP Version: 4.0.3pl1 OS: N/A
Private report: No CVE-ID: None
 [2000-11-22 08:17 UTC] muhlig at us dot edu dot pl
From PHP Manual: ... htmlentities... At present, the ISO-8859-1 character set is used. 

I feel there is strong need to make htmlentities to support other charsets than ISO 8859-1. We, here in Poland for instance, use ISO 8859-2. Many Western/USA freeware programs use (as they of course should) htmlentities. Proper display of our diacritic chars is then impossible. We have to modify sources, removing htmlentities or defining own functions. It's a waste of time and resources. May I ask PHP developers to consider this issue?



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-23 07:40 UTC]
BTW: you can use recode("ISO8859-2..h4",$text) for this
purpose. See GNU recode extension and recode docs for more

 [2002-04-27 17:29 UTC]
for most if the iso 8859-2 charset, there are no standard html entities, and the current behavior of htmlentities() is to leave such characters unconverted.

the real problem is that the current behavior of htmlentities() when passed an unknown charset is to use the iso 8859-1 mapping. it shouldn't try to use a charset mapping in that case.
 [2004-11-04 17:13 UTC] rf at astro dot uni dot torun dot pl
Sorry, I am not PHP programmer... I just found that Polish characters in form entries (in not my software) are converted to html entities (and displayed incorrectly); I tracked thing to happen in htmlentities() function. 
I am using Apache/2.0.48 (Unix) mod_ssl/2.0.48 OpenSSL/0.9.6b PHP/4.3.5-dev, it has been a few years since 2000; maybe the programmer should use another thing for checking the input... ;)

 [2010-12-01 15:53 UTC]
-Package: Feature/Change Request +Package: Strings related
 [2011-09-16 21:08 UTC]
-Status: Analyzed +Status: Closed -Assigned To: +Assigned To: tyrael
 [2011-09-16 21:08 UTC]
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at

htmlentities supports this via the third optional charset argument since 4.1.0
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 19 21:01:28 2024 UTC