I’m following this tutorial:
http://www.vogella.com/articles/RSSFeed/article.html
It works great and i’m able to get all the information I need.
However, all the ‘fields’ contents is in Hebrew, so when I parse it and display the results, all I get is something like this (after manipulating and removing unnecessary tags):
Question: 1536. ??? ??? ????? ????? ????? ????? ?????? ??? ???? ???? ??????. ???:
Answers:
1: ???? ?? ????? ?? ?? ????? ?????? ?? ?????.
2: ???? ?? ????? ?? ???? ???? ???? ?????.
3: ???? ?? ????? ?? ???? ???? ???? ?????, ????? ?????? ???????.
4: ???? ???? ???? ????? ?? ???? ????, ?? ???? ???? ????- ?????.
The XML is encoded in UTF-8 and looks as it should in a web browser.
I tried explicitly setting the ecnoding with this line:
XMLEventReader eventReader = inputFactory.createXMLEventReader(in,"UTF-8");
But that didn’t work. I tried changing the XML’s encoding to unicode (as well as the above line) but still the same result.
I’m suspecting it might only be an eclipse encoding issue, because when doing something like this:
System.out.println("סתם עברית");
results in printing ??? ?????
The project is for an Android app, if it matters.
Can anyone help me solve this?
Thanks in advance!
Just to close this one up, the reason was that the file itself was in the wrong encoding.
After typing in a few words in Hebrew and then trying to save the file, it alerted me that the encoding is different. after saving it in the suggested encoding, it worked.