While I would expect your second approach to work, it's important to note that IT IS NOT REQUIRED TO WORK.
The XML standard does not require XML processors to support anything other than UTF-8 or UTF-16. In this day and age, I would STRONGLY discourage use of anything other than UTF-8, or, rarely, UTF-16. Another factor to consider is how you're getting access to those characters. You must do this one of two ways: 1) Using a Reader set to read 8859-1 -or- 2) Using an input stream, giving the raw bytes to the parser, letting it decode the 8859-1 characters. You WILL FAIL (and this is probably your problem, would be my guess) if you try to read using a Reader that's expecting UTF-8. A stacktrace should show which problem you have. On Feb 2, 6:42 am, MobDev <[email protected]> wrote: > Hi, > I am downloading a xml-type file from a webserver which starts out > with : > > <?xml version="1.0" encoding="iso-8859-1" ?> > > afterwards I get a list with loads of countries, some countries do > contain some letters like é and á. > > I have tried to extract the data of the xml in two ways : > 1 - simply download the whole thing into a String, which will result > in those characters being seen as something like [] or on the Android > emulator (and device) I will see a triangle with a ? in it... > > 2 - fetch the list with the SAXParser and XMLReader which will just > throw an exception telling me that there is some content error... > specifically at the line where the first country is with such a > character... > > So is there some way to get this to work ? Can I read the iso-8859-1 > encoded xml into the Parser ? Or is there some way to encode/decode > the received data into something actually usable ? > Any idea where the problem might be ? > > Thanks in advance for any hints, tips, code or explanation :D -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

