Problem parsing Google weather data only for Paris

梦想与她 提交于 2019-12-13 04:44:01

问题


I have created an app for weather reports by using this http://www.google.com/ig/api?weather=paris. It works well for all cities except Paris.

In my app I have a text field; if I type "Sydney", it will show the weather in Sydney, but if I type "Paris", it gives an error: NSXMLParserErrorDomain error:9. I don't know what it means. What could be the error? Any idea?


回答1:


According to Apple's documentation it has encountered an illegal character: NSXMLParserInvalidCharacterError = 9,

Make sure you correctly parse this as UTF-8




回答2:


It seems that XML you are parsing contains some UTF-8 characters, but XML does not have proper XML declaration for UTF-8.

Make sure you configure your parser correctly.



来源:https://stackoverflow.com/questions/5964214/problem-parsing-google-weather-data-only-for-paris

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!