#44321 [Opn->Fbk]: json_decode will not decode json string with chars like
| From: | jani@php.net | Date: | Mon, 21 Jul 2008 21:34:45 +0000 |
| Subject: | #44321 [Opn->Fbk]: json_decode will not decode json string with chars like | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-127100@lists.php.net to get a copy of this message | ||
ID: 44321
Updated by: jani@php.net
Reported By: vzeman at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: JSON related
-Operating System: Windows/Linux
+Operating System: *
PHP Version: 5.2.5
-Assigned To:
+Assigned To: fb-req-jani
New Comment:
As clearly control characters are not allowed by the JSON spec, what
exactly should happen here? IMO, it's working like it should now..
Previous Comments:
------------------------------------------------------------------------
[2008-06-28 19:16:44] work at anomalizer dot net
Agree with tom@ that the JSON spec does not permit control characters
See http://json.org/
Also try using a validator like http://www.jslint.com/
------------------------------------------------------------------------
[2008-03-19 19:32:59] tom at inetz dot com
I think the problem here is that json_decode has problems decoding
strings with control characters. I have experienced this problem with
multiple control characters.
------------------------------------------------------------------------
[2008-03-04 12:29:28] vzeman at gmail dot com
Description:
------------
json_decode will not decode string if in value is string like ""
Reproduce code:
---------------
try to decode string like this:
{"params":[{"body":"Hello,Regards,"}]}
Expected result:
----------------
params object should contain entry body with text: Hello,Regards,
Actual result:
--------------
encoding will stop on character R
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44321&edit=1