How to parse XML with special characters?
Whenever I try to parse XML with special characters such as ō or 満月先生 I get an error. The xml documents claims to use UTF-8 encoding but that does not seem to be the case. Here is what the troublesome text looks like when I view the XML in Firefox:
Bleach: The Diamond Dust Rebellion - M� Hitotsu no Hy�rinmaru; Bleach - The DiamondDust Rebellion - Mou Hitotsu no Hyourinmaru
On the actual website, Å� is actually the character ō.
<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 o开发者_运维问答f the dangerous approximation of the "star of the Underworld" to the Earth's orbit.<br /> <br />
And once again, on the actual website, those characters appear as 満月先生 and 美夜子.
The actual XML file is formatted properly other than those special characters, which certainly do not appear to be using the UTF-8 encoding. Is there a way to get NSXML to parse these XML files?
To use other characters than those who are utf-8, you need to use their special character code. If you want to represent ö
you need to type ö
Find more on
Wikipedia: http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
精彩评论