我有这种格式的数据:U+597D或者像这样U+6211.我想将它们转换为UTF-8(原始字符是好和我).我该怎么做?
我想将Unicode代码点转换为字符.这是我尝试过的:
$point = dechex(127468); // 1f1ec
echo "\u{1f1ec}"; // this works
echo "\u{$point}"; // this outputs '\u1f1ec'
echo "\u{{$point}}"; // Parse error: Invalid UTF-8 codepoint escape sequence
echo "\u\{{$point}\}"; // outputs \u\{1f1ec\}
echo "\u{". $point ."}"; // Parse error; same as above
Run Code Online (Sandbox Code Playgroud)