开发者

Problem with swedish characters (åäö) when downloading xml in android

开发者 https://www.devze.com 2023-03-23 23:22 出处:网络
In my android app, i download a xml file from a server, construct a xml doc out of it, pars itand display the info in an layout with the开发者_如何学编程 usual setText method. However the Swedish char

In my android app, i download a xml file from a server, construct a xml doc out of it, pars it and display the info in an layout with the开发者_如何学编程 usual setText method. However the Swedish characters åäö wont show correctly.

I have no idea how to fix this, any tips?


if you are using eclipse ide go to preferences under Window menu, then under General node, select Workspace, in the window shown, change the text file encoding to UTF8..

and you can change the encoding per file from its properties window


I found the problem, it was the in the beginning that was not suppose to be there. I'm not really sure why, the xml file is encoded with UTF-8 anyway, but the DocumentBuilder was not able to build a Document out of it when that line was first.

Thanks for the tips that lead me to it!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号