PHP Bugs  
php.net | support | documentation | report a bug | advanced search | search howto | statistics | login

go to bug id or search bugs for  

Bug #48230 xml_utf8_decode incorrectly decode
Submitted:11 May 2:41am UTC Modified: 11 May 1:08pm UTC
From:root at 80sec dot com Assigned to:
Status:Bogus Category:XML related
Version:5.2.9 OS:Linux/win
View/Vote Developer Edit Submission

[11 May 2:41am UTC] 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.
[11 May 9:27am UTC] jani@php.net
RTFM:
"This function decodes data , assumed to be UTF-8 encoded, to ISO-8859-
1."
[11 May 12:24pm UTC] root at 80sec dot com
chr(0xf0).chr(0xc0).chr(0xc0).chr(0xa7)

is not a valid utf8 data.
[11 May 1:08pm UTC] derick@php.net
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.

RSS feed | show source 

PHP Copyright © 2001-2009 The PHP Group
All rights reserved.
Last updated: Sat Nov 21 10:30:49 2009 UTC