php - JSON encode unicode issue on PHP5.3 -
a string in hebrew after json_encode looks this: [{"id":"1","value":"\u05d1\u05dc\u05d0\u05d2\u05df"} idea encoding , how either work or readable again? btw, joomla system runs on php 5.3, string post request, not database , utf-8 meta tag exist.
that's how json encodes non-ascii characters. text readable again when pass through json parser.
php 5.4 defines new option json_encode
, json_unescaped_unicode
, pass utf-8 text through as-is without converting escape codes. since using php 5.3 can't use it, if had 5.4 how used:
$json = json_encode($obj, json_unescaped_unicode); // php 5.4 required
however, should not needed because json parser decode escape codes.
Comments
Post a Comment