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

 ID:                 53946
 Patch added by:     ir...@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:

The following patch has been added/updated:

Patch Name: bug53946.phpt
Revision:   1311091344
URL:        
https://bugs.php.net/patch-display.php?bug=53946&patch=bug53946.phpt&revision=1311091344


Previous Comments:
------------------------------------------------------------------------
[2011-07-19 12:01:33] ir...@php.net

The following patch has been added/updated:

Patch Name: json_unescaped_unicode
Revision:   1311091293
URL:        
https://bugs.php.net/patch-display.php?bug=53946&patch=json_unescaped_unicode&revision=1311091293

------------------------------------------------------------------------
[2011-03-25 17:59:42] trolzen at gmail dot com

Maybe it's worth mentioning in manual that json_encode converts national 
characters into strings like \uxxxx and that there is no way to change this 
behaviour yet?

------------------------------------------------------------------------
[2011-02-10 20:42:42] scott...@php.net

Seems reasonable to add.

------------------------------------------------------------------------
[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 https://bugs.php.net/bug.php?id=53946&edit=1

Reply via email to