gpt4 book ai didi

iphone - 接收 ?当 smiley(\ue415) 被发布到服务器时

转载 作者:行者123 更新时间:2023-11-29 13:39:49 29 4
gpt4 key购买 nike

我正在尝试向服务器发送笑脸。

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:PostMessage>
<tem:UserID>1</tem:UserID>
<tem:FriendID>3</tem:FriendID>
<tem:Message>\ue415</tem:Message>
</tem:PostMessage>
</soapenv:Body>
</soapenv:Envelope>

这是我发布到服务器的内容。但是服务器将消息作为 ? 获取。所以其他用户也收到消息 ? 而不是笑脸 (:D) 的\ue415。

最佳答案

\ue415 是 16 位字符代码,但您的文件指定 UTF-8 编码——因此您需要将该字符转换为正确的 UTF-8 序列。根据http://www.utf8-chartable.de/unicode-utf8-table.pl?start=58368这是

ee 90 95

因此,如果客户端的格式正确,用 \xee\x90\x95 替换\ue415 将起作用。如果它需要 HTML 实体,它会是 (或类似的东西)。


还有一件事:我刚刚想到,我看到的表情符号都采用 UTF-16 格式的两个字符。事实证明 0xE415 是一种老式的表情符号编码(here's 关于它的 SO 帖子)。在新的 unicode 标准中,该表情符号的代码是 0x1f604,或者在 UTF-8 中:

F0 9F 98 84

关于iphone - 接收 ?当 smiley(\ue415) 被发布到服务器时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9463243/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com