Forums Register Login

Special character string display

+Pie Number of slices to send: Send
Hi All,

I am parsing the xml which i am getting from serverside, and displaying the string on Android UI.

At one tag of xml I am getting some special characters "Atrévete a Soñar". On android phone and wordpad it shows same, But If I open same xml in mozilla it shows same string as "Atrévete a Soñar". I want to display this on Android UI same like how it shows in mozilla. Is there any string conversion code in JAVA by which I can do this?

Thanks in advance
Nehel
+Pie Number of slices to send: Send
What encoding is the file in? How are you handling that?
+Pie Number of slices to send: Send
I have not done any encoding. Let me know if I neet to to do any encoding. This is simple text (string) coming from server and I am displaying on android UI.
+Pie Number of slices to send: Send
Every time you have text that goes beyond US-ASCII you need to concern yourself with encoding. Start by finding out which encoding the XML file is in that the server sends you; being XML, it may have that information in ?xml processing directive. If so, make sure that the actual encoding is the same as what's specified by that directive.
+Pie Number of slices to send: Send
Hey I got the solution




I did this and now I am getting Spanish characters correctly instead of junk characters.
output: strSpanish : Atrévete a Soñar (how I wanted ) :-)

I have reffered below link
http://java.sun.com/developer/technicalArticles/Intl/HTTPCharset/
Get out of my mind! Look! A tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 7795 times.
Similar Threads
I want to display xml in the browser with jsp
Passing the JSTL variable (with special characters) to JavaScript function?
Mozilla help for xslt
Which IDE for developing Android application?
Reading file in Android
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 05:43:38.