UTF-8 中阿拉伯字符的字符串编码
阿拉伯名称应通过 SOAP 发送。名称编码如下:
<value>محمد عبدالله هلال</value>
但是,当使用一些在线转换器将上述内容转换为 UTF-8 时,结果如下所示:
Ù…ØÙ…Ø̄ Ø1Ø´Ø̄الله هلال
我在这里缺少什么才能显示正确的阿拉伯字符?
谢谢,
罗伯特
An Arabic name shall be sent via SOAP. The name is encoded like this:
<value>Ù
ØÙ
د عبداÙÙÙ ÙÙاÙ</value>
However when converting the above to UTF-8 with some online converters the result looks like this:
Ù
ØÙ
د عبداÙÙÙ ÙÙاÙ
What am I missing here so that the correct Arabic characters are displayed?
Thanks,
Robert
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您显示的编码数据确实对您显示的无意义数据进行编码(或类似的数据,因为它实际上也编码了一些不可打印的字符)。
所以你的输入已经是错误的。
您也许可以挽救它,但正确的解决方案是首先确保输入正确。
The encoded data you showed does encode the nonsensical data you showed (or similar, because it actually encodes some unprintable characters as well).
So your input is already wrong.
You might be able to salvage it, but the correct solution would be to make sure that the input is correct in the first place.
这是从 Android 发送
UTF-8
数据时出现的问题。您的代码可以正常工作,只是您必须将String
编码为Base64
。在服务器上,您只需解码Base64
String
即可。这对我有用。如果您需要代码我可以分享。This has been the problem Sending
UTF-8
data from Android. Your code would work fine except that you will have to encode yourString
toBase64
. At Server you just decodeBase64
String
back. It worked for me. I can share if you need the code.