0

Possible Duplicate:
Json_encode Charset problem

How can I produce JSON unescaped unicodes in php 5.3.x ?

example:

array("name"=>"some unicode chars");

will be JSONed like this :

{"name":"\Uxxx\Uyyy\Uzzz\Usss \U123......."}

where xxx and yyy are the equivalent unicode values of the characters in the original array.

Now I need the JSON to output like this:

{"name":"some unicode chars"}

Community
  • 1
  • 1
Shehabic
  • 6,787
  • 9
  • 52
  • 93
  • 7
    Why? The JSON parser on the other end will handle the escapes perfectly fine. – SLaks Aug 01 '12 at 14:48
  • Yes I think it's doing it the proper way already. –  Aug 01 '12 at 14:50
  • And eschwing them might even make it non-compliant, so that some JSON parsers do not decode it afterwards. – mario Aug 01 '12 at 14:50
  • Well when you have 10 paragraphs in a page all in unicode characters ( size would increas 4-5 times each character is changed to 5 characters – Shehabic Aug 01 '12 at 15:43
  • I have checked the source of the page in Google+ and Facebook+ and all the Ajax requests. . then don't encode unicode characters in JSONs – Shehabic Aug 01 '12 at 15:44

0 Answers0