Reputation: 8906
I would like to convert a mb string to UTF escape sequence.
Hello
to
\u0048\u0065\u006c\u006c\u006f
How to do such a thing?
Upvotes: 2
Views: 67
Reputation: 1167
use json_encode("русский")
and you get "\u0440\u0443\u0441\u0441\u043a\u0438\u0439"
for English not requer encode to utf-8 escaped string. Для русского обязательно.
Upvotes: 1