Arabic Characters in JSON decoding
json, php
Solution
`"\u0628\u0633\u0645 \u0627\u0644\u0644\u0647"` and `"بسم الله"` are equivalent in JSON.
PHP just defaults to using Unicode escapes instead of literals for multibyte characters.
You can specify otherwise with JSON_UNESCAPED_UNICODE (providing you are using PHP 5.4 or later).
json_encode('بسم الله', JSON_UNESCAPED_UNICODE);
Problem
``` $test = json_encode('بسم الله'); echo $test; ``` As a result of this code, the output is: `"\u0628\u0633\u0645 \u0627\u0644\u0644\u0647"` while it should be something like "بسم الله". Arabic Characters are encoded when being JSON encoded while at the Youtube API this is not the case: http://gdata.youtube.com/feeds/api/videos/RqMxTnTZeNE?v=2&alt=json You can see at Youtube that Arabic characters are displayed properly. What could be my mistake? HINT: I'm working on an API< the example is just for the sake of clarification.