xhr Rss Feed - Special Characters
Hi..
From the KitchenSink project I used the xhr xml example. I have a RSS feed (including special danish characters æøå): http://snowboard.riders.dk/feed/ which Im trying to show in the android browser.
I have developed several native applications in xcode for the iPhone including feeds, so I have experience with this.
I have tried many methods to show the feed correctly, without succes.
- convert feed (html entities)
- custom html header in webview
- looked at titanium webview documentation
How do I show special characters in the Android browser?
3 Answers
-
No help?
-
Look this:
http://developer.appcelerator.com/question/40941/xhr-xml-codification-issue
I hope it work for you!
-
Hi, some time ago I posted a similar question here: http://developer.appcelerator.com/question/56091/xml-parser-unable-to-correctly-handle-numeric-entities-android.
It seems that the xml parser in Titanium on Android is somewhat buggy.
Here: http://gist.github.com/580493 you can find the code I'm using right now to overcome the problem.
You can use the function in the following way:
var xhr = Titanium.Network.createHTTPClient(); xhr.onload = function(){ var xmlStr = this.responseText; var xmlDoc = Ti.XML.parseString(mgDecodeHTMLEntities(xmlStr))); //perform usual processing }); //[...]
I hope it will help!