Edit report at http://bugs.php.net/bug.php?id=53946&edit=1

 ID:                 53946
 Updated by:         scott...@php.net
 Reported by:        christian dot pernot at pingroom dot net
 Summary:            add json_encode option for not escaping unnecessary
                     character
 Status:             Assigned
 Type:               Feature/Change Request
 Package:            JSON related
 PHP Version:        5.3.5
 Assigned To:        scottmac
 Block user comment: N
 Private report:     N

 New Comment:

Seems reasonable to add.


Previous Comments:
------------------------------------------------------------------------
[2011-02-07 10:22:03] christian dot pernot at pingroom dot net

Description:
------------
It would be great to have a option for json_encode which make possible
to keep non-ascii character "as such" in strings (and not \uxxxx), which
is the case for example with mozilla's JSON.stringify.



json.org states string can have
"any-Unicode-character-except-"-or-\-or-control-character"

Test script:
---------------
$str = "test accentué";

echo json_encode($str);



gives 



"test accentu\u00e9"

Expected result:
----------------
"test accentué"

Actual result:
--------------
"test accentu\u00e9"


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53946&edit=1

Reply via email to