PHP: To decode json to chinese and smily not works? -
this question has answer here:
- unicode character in php string 6 answers
to decode json chinese: json_decode('"\ud83d\ude18\ud83d\ude18\ud83d\ude18\ud83d\ude18\u597d\u5bb6\u4f19\ud83d\ude0d\ud83d\ude0d\ud83d\ude0d"'); not works?
it works chinese not smily
can please give me idea it
that's not valid json string -- json strings must inside double quotes
edit: took failing example above, wrapped utf-8 in doublequotes, , decoded:
var_dump(json_decode('"\ud83c\udf83\ud83c\udf83\ud83c\udf83"')); string(12) "🎃🎃🎃"
(i don't know glyphs should like, don't eve know if have right fonts installed, string decoded)
Comments
Post a Comment