Saturday, March 24, 2012

[android-developers] Re: How to handle unicode expression included in String

I found the solution.

Unicode expressions like """ can be regarded as one of HTML
string.
So, I made the function which convert html string into a normal
String.


public static String convertHtmlTagInString(String orignalString) {
Spanned spanned = Html.fromHtml(orignalString);
String changedString = spanned.toString();

return changedString;
}

On Mar 23, 2:53 pm, Jaden Pak <jadenpak...@gmail.com> wrote:
> When I received RSS content from a News source, I found that there are
> some unicode expressions in the String.
> The format of expression is like  "&#nn;"
>
> "Result announced &#34;New products are ...&#34;"
>
> Because there is no problem like this from all other the news sources,
> I think this is not the common case,
>
> Anyway, what I want now is extracting these expression from the
> string
> and if possible converting into characters which can be viewed in
> TextView.
>
> I want to know how to handle in normal way with Java or Android.
>
> Thanks in advance!!!

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment