#45232 [Opn->Bgs]: json_decode() doesn't decode special characters
| From: | derick@php.net | Date: | Wed, 11 Jun 2008 09:51:27 +0000 |
| Subject: | #45232 [Opn->Bgs]: json_decode() doesn't decode special characters | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-125668@lists.php.net to get a copy of this message | ||
ID: 45232
Updated by: derick@php.net
Reported By: crazed007 at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: JSON related
Operating System: Windows
PHP Version: 5.2.6
New Comment:
Not a bug, JSON needs to be UTF-8 encoded.
Previous Comments:
------------------------------------------------------------------------
[2008-06-11 09:46:46] crazed007 at gmail dot com
Description:
------------
When decoding a JSON encoded string which contains a special character
like é or è, json_decode() returns a null.
Reproduce code:
---------------
$foo = '[{"city":"genève"}]';
$obj = json_decode($foo);
var_dump($obj);
Expected result:
----------------
array
0 =>
object(stdClass)[1]
public 'city' => string 'genève' (length=6)
Actual result:
--------------
null
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45232&edit=1