|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45232 json_decode() doesn't decode special characters
Submitted: 2008-06-11 09:46 UTC Modified: 2008-06-11 09:51 UTC
From: crazed007 at gmail dot com Assigned:
Status: Not a bug Package: JSON related
PHP Version: 5.2.6 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: crazed007 at gmail dot com
New email:
PHP Version: OS:


 [2008-06-11 09:46 UTC] crazed007 at gmail dot com
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);

Expected result:
  0 => 
      public 'city' => string 'gen?ve' (length=6)

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-11 09:51 UTC]
Not a bug, JSON needs to be UTF-8 encoded.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Feb 26 12:01:26 2024 UTC