PHP: To decode json to chinese and smily not works? -


this question has answer here:

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

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -