I have my data in this format: U+597D or like this U+6211. I want to convert them to UTF-8 (original characters are 好 and 我). How can I do it?
U+597D
U+6211
$utf8string = html_entity_decode(preg_replace("/U+([0-9A-F]{4})/", "&#x\1;", $string), ENT_NOQUOTES, 'UTF-8');
is probably the simplest solution.
2.1m questions
2.1m answers
60 comments
57.0k users