#48230 [Bgs]: xml_utf8_decode incorrectly decode
| From: | derick@php.net | Date: | Mon, 11 May 2009 13:08:48 +0000 |
| Subject: | #48230 [Bgs]: xml_utf8_decode incorrectly decode | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-137157@lists.php.net to get a copy of this message | ||
ID: 48230
Updated by: derick@php.net
Reported By: root at 80sec dot com
Status: Bogus
Bug Type: XML related
Operating System: Linux/win
PHP Version: 5.2.9
New Comment:
We know it is not, but the function only works on proper UTF-8 like is
documented. So there is no bug here, the bug is on your code calling
this function. You can't require functions to work like they're not
meant to workâbut that's what you're asking here.
Previous Comments:
------------------------------------------------------------------------
[2009-05-11 12:24:53] root at 80sec dot com
chr(0xf0).chr(0xc0).chr(0xc0).chr(0xa7)
is not a valid utf8 data.
------------------------------------------------------------------------
[2009-05-11 09:27:12] jani@php.net
RTFM:
"This function decodes data , assumed to be UTF-8 encoded, to
ISO-8859-
1."
------------------------------------------------------------------------
[2009-05-11 02:41:26] root at 80sec dot com
Description:
------------
xml_utf8_decode function incorrectly decode.
Reproduce code:
---------------
<?php
$ill=chr(0xf0).chr(0xc0).chr(0xc0).chr(0xa7);
$ill=addslashes($ill);
echo utf8_decode("$ill");
echo htmlspecialchars ($ill,ENT_QUOTES,"utf-8" );
?>
Expected result:
----------------
it will output a "'" incorrectly.
Actual result:
--------------
it will output a "'" incorrectly.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48230&edit=1