gpt4 book ai didi

iphone - 如何解析带有特殊字符的XML?

转载 作者:数据小太阳 更新时间:2023-10-29 02:09:37 24 4
gpt4 key购买 nike

每当我尝试解析带有特殊字符(例如 ō 或満月先生)的 XML 时,我都会收到错误消息。 xml 文档声称使用 UTF-8 编码,但事实并非如此。当我在 Firefox 中查看 XML 时,麻烦的文本如下所示:

Bleach: The Diamond Dust Rebellion - M� Hitotsu no Hy�rinmaru; Bleach - The DiamondDust Rebellion - Mou Hitotsu no Hyourinmaru

在实际的网站上,Å�实际上是字符ō。

<br /> One day, Doraemon and his friends meet Professor Mangetsu (����, Professor Mangetsu?), who studies magic and magical beings such as goblins, and his daughter Miyoko (���, Miyoko?), and are warned of the dangerous approximation of the &quot;star of the Underworld&quot; to the Earth&#039;s orbit.<br /> <br />

再一次,在实际网站上,这些字符显示为満月先生和美夜子。

除了那些特殊字符外,实际的 XML 文件格式正确,这些特殊字符肯定不会使用 UTF-8 编码。有没有办法让 NSXML 解析这些 XML 文件?

最佳答案

要使用非utf-8的字符,需要使用他们的特殊字符编码。如果你想表示 ö 你需要输入 ö

了解更多
维基百科:http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

关于iphone - 如何解析带有特殊字符的XML?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2979577/

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