json - php json_encode korean character broken. how to solve this? -
php json_encode korean character broken. how solve this?
i used var_dump
but need json type.
my web hosting 5.2 php version, can't use
print(json_encode($json_output, json_unescaped_unicode));
while($row=mysqli_fetch_assoc($query)) { $json_output[]=$row; } print(json_encode($json_output));
bellow broken character
[ { "name":"chulhoon", "description":"\ud558\ud558\ud638\ud638", "dob":"\uc548\ub155\ud558\uc138\uc694", "county":"\ub9cc\ub098\uc11c", "height":"\ubc18\uac00\uc6cc\uc694", "spouse":"\ubb50\ub4e4\ud558\uc138\uc694", "children":"\uc774\ubbf8\uc9c0\uc55e\uc790\ub9ac", "image":"http:\/\/microblogging.wingnity.com\/jsonparsingtutorial\/johnny.jpg" } ]
this not broken. these strange sequences unicode characters. can try use
print(json_encode($json_output, json_unescaped_unicode));
instead, if you're php >= 5.4. should keep unicode characters in original form. result in other problems when storing or transferring json string.
Comments
Post a Comment