I've got such strings
\u041d\u0418\u041a\u041e\u041b\u0410\u0415\u0412
How can I convert this to utf-8 encoding? And what is the encoding of given string? Thank you for participating!
I've got such strings
\u041d\u0418\u041a\u041e\u041b\u0410\u0415\u0412
How can I convert this to utf-8 encoding? And what is the encoding of given string? Thank you for participating!
The simple approach would be to wrap your string into double quotes and let json_decode
convert the \u0000
escapes. (Which happen to be Javascript string syntax.)
$str = json_decode("\"$str\"");
Seems to be russian letters: НИКОЛАЕВ
(It's already UTF-8 when json_decode
returns it.)
To parse that string in PHP you can use json_decode
because JSON supports that unicode literal format.