#25883 [Bgs]: htmlentities($value, ..., "UTF-8") doesn't to UTF-8 correctly and completely
| From: | thomas at haeber dot de | Date: | Thu, 16 Oct 2003 15:09:10 +0000 |
| Subject: | #25883 [Bgs]: htmlentities($value, ..., "UTF-8") doesn't to UTF-8 correctly and completely | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-49095@lists.php.net to get a copy of this message | ||
ID: 25883
User updated by: thomas at haeber dot de
Reported By: thomas at haeber dot de
Status: Bogus
Bug Type: Strings related
Operating System: SuSE Linux 8.2 (2.4.20)
PHP Version: 4.3.1
New Comment:
Hi,
I don't know why this shoudn't be a bug, but when you say it, it is
so.
Can I ask you, when i can count on php will recognize this issue so i
can use htmlentities($String, ..., "UTF-8") to convert ° to °
instead of °, or when this function will convert these french
letters to them UTF-8-equivalent?
Otherwise i have to use an ugly workaround, which could be unneccessary
in the future.
THX
Thomas
Previous Comments:
------------------------------------------------------------------------
[2003-10-15 19:08:52] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Whenever possible PHP will prefer html entities over &#[number];
------------------------------------------------------------------------
[2003-10-15 10:21:11] thomas at haeber dot de
Description:
------------
Hi guys,
I used the htmlentities-function for converting values of different
Languages to UTF-Code - see example 1.
But PHP doesn't convert these accent-letters to UTF-8-Code.
Furthermore I've realized that PHP doesn't converts the °-Symbol to
° but to ° - see example 2.
Reproduce code:
---------------
// example 1:
$value = "LA RÉCRÉ"; // with accent-letters of french language
$value = htmlentities($value, ENT_QUOTES, "UTF-8");
echo $value;
// Output: LA RÉCRÉ (not LA RÉCRÉ)
// example 2:
$value = "13°";
$value = htmlentities($value, ENT_QUOTES, "UTF-8");
echo $value;
// OUTPUT: 13° (not 13°)
Expected result:
----------------
LA RÉCRÉ
13°
Actual result:
--------------
htmlentities (UTF-8) converts ° wrongly to °.
htmlentities doesn't convert french accent-letters.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25883&edit=1