#47146 [Com]: htmlentities function doesn't convert german umlauts correctly
| From: | teiseler at gmx dot de | Date: | Wed, 21 Jan 2009 10:37:21 +0000 |
| Subject: | #47146 [Com]: htmlentities function doesn't convert german umlauts correctly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-133098@lists.php.net to get a copy of this message | ||
ID: 47146
Comment by: teiseler at gmx dot de
Reported By: teiseller at gmx dot de
Status: Feedback
Bug Type: Strings related
Operating System: Windows XP SP2
PHP Version: 5.2.8
New Comment:
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).
Previous Comments:
------------------------------------------------------------------------
[2009-01-19 12:33:54] jani@php.net
What if you pass the correct charset in use to the function?
(see http://php.net/htmlentities/ for more)
------------------------------------------------------------------------
[2009-01-19 11:03:50] 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
"")
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47146&edit=1