0

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?

jscs
  • 63,694
  • 13
  • 151
  • 195
Aravindhan
  • 15,608
  • 10
  • 56
  • 71

2 Answers2

2

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

Make sure you correctly parse this as UTF-8

Claus Broch
  • 9,212
  • 2
  • 29
  • 38
  • but that app is working well for all cities.. i used cities like london,sydney,ooty,trichy,delhi.. it is working well for this cities but it is not working only for paris... – Aravindhan May 11 '11 at 12:36
  • @aravindhanarvi: "Paris, Île-de-France" contains characters you're not likely to find in "London", "New Delhi, Delhi", etc. – Wooble May 11 '11 at 12:38
  • Paris is defined in the feed as ""Paris, Île-de-France" -- do the other cities' data contain UTF-8 characters like "Î"? – Matt Gibson May 11 '11 at 12:39
  • @wooble: i am referring .. and like that.. – Aravindhan May 11 '11 at 12:42
  • @Aravindhanarvi: I suggest you actually read the contents of the link you posted. The parser needs to be able to read the whole thing, and since it's utf-8 encoded you can't treat it like it's ASCII. – Wooble May 11 '11 at 12:44
1

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.

Peter Knego
  • 79,991
  • 11
  • 123
  • 154