Bug #63261 [Opn]: htmlentities and htmlspecialchars have problemens with german umlauts
| From: | rasmus@php.net | Date: | Fri, 12 Oct 2012 05:13:23 +0000 |
| Subject: | Bug #63261 [Opn]: htmlentities and htmlspecialchars have problemens with german umlauts | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-174045@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63261&edit=1
ID: 63261
Updated by: rasmus@php.net
Reported by: hartz at mobilecity dot de
Summary: htmlentities and htmlspecialchars have problemens
with german umlauts
Status: Open
Type: Bug
Package: Output Control
Operating System: Linux SLES 10
PHP Version: 5.4.7
Block user comment: N
Private report: N
New Comment:
You need to specify the encoding. If you are using latin1, do:
htmlentities('ÃÃÃäöüÃ',NULL,'ISO-8859-1');
PHP 5.4 defaults to UTF-8 because most of the world has switched at this point.
Previous Comments:
------------------------------------------------------------------------
[2012-10-11 13:10:10] hartz at mobilecity dot de
My shell encoding and my editor encodings are setted to latin1.
This is also no utf8-encoding-problem.
The error occurs after updating my server from 5.3.17 on 5.4.7.
The php source codes still the same like before the update.
------------------------------------------------------------------------
[2012-10-11 12:53:06] hartz at mobilecity dot de
In PHP 5.3.x the expected result will be returned. After an update on 5.4.7 it works no more
------------------------------------------------------------------------
[2012-10-11 12:51:08] hartz at mobilecity dot de
Description:
------------
Hi,
with the following line of code you can see the problem.
In PHP 5.4.7 the funtions htmlentities and htmlspecialchars didn't support no more german
umlauts. They returns an empty string.
Best regards,
Stephan
Test script:
---------------
echo "TEST:".
htmlentities('ÃÃÃäöüÃ')."|".htmlspecialchars('ÃÃÃäöüÃ')."|".'ÃÃÃäöüÃ';
Expected result:
----------------
TEST:
ÄÖÜäöüß|ÃÃÃäöüÃ|ÃÃÃäöüÃ
Actual result:
--------------
TEST: ||ÃÃÃäöüÃ
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63261&edit=1