【发布时间】:2019-07-13 06:28:28
【问题描述】:
$message = "Spanish Language
á, é, í, ó, ú, ñ, ü
???? ???? ???? ???? ???? ???? ???? ????";
$hex = '@U' . strtoupper(bin2hex(mb_convert_encoding($message, 'UCS-2','auto')));
当我将 $hex 发送到以下 API 时,除了表情符号之外,其他一切都很好,如果手机中出现表情符号 ? 符号
https://api.txtlocal.com/docs/encodingdecodingunicode
请纠正我做错了什么。
【问题讨论】:
-
UCS-2是必需的吗? -
不是 100% 确定,只是按照文档示例,我尝试使用 UCS-4 但同样的问题
-
如果你使用
mb_convert_encoding($message, 'UTF-8','auto')呢? -
我尝试使用 UTF-8 但收到空消息
标签: php unicode encoding hex emoji