php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47146 htmlentities function doesn't convert german umlauts correctly
Submitted: 2009-01-19 11:03 UTC Modified: 2009-01-27 01:00 UTC
Votes:11
Avg. Score:4.0 ± 0.9
Reproduced:10 of 10 (100.0%)
Same Version:4 (40.0%)
Same OS:2 (20.0%)
From: teiseller at gmx dot de Assigned:
Status: No Feedback Package: Strings related
PHP Version: 5.2.8 OS: Windows XP SP2
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: teiseller at gmx dot de
New email:
PHP Version: OS:

 

 [2009-01-19 11:03 UTC] teiseller at gmx dot de
Description:
------------
the function htmlentities($string) does not convert german umlauts to the coresponding html entity. For example, an "?" is convertet into "ü" instead of ü.

Reproduce code:
---------------
just perform the htmlentities function on any string containing a german umlaut, e.g. ?    ?     ?

Expected result:
----------------
it should return the string with the following substitutes:

? --->  ä          
? --->  ü
? --->  ö
? --->  Ä          
? --->  Ü
? --->  Ö

Actual result:
--------------
it returns cryptic chars for these characters, like "ü" (without the "")

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-19 12:33 UTC] jani@php.net
What if you pass the correct charset in use to the function?
(see http://php.net/htmlentities/ for more)
 [2009-01-21 10:37 UTC] teiseler at gmx dot de
Thanks, that worked. But in this case, there is still an error either with the documentation or the function.
The Documentation sais:
"Presently, the ISO-8859-1 character set is used as the default". But all I did was to specify this exact charset:

$settings["sitetitle"] = htmlentities($_POST["SITETITLE"], ENT_COMPAT, "ISO8859-1");

this should be the default settings for the function (at leaste the documentation states so).
 [2009-01-27 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 23:01:28 2024 UTC