问题
There is a String in Android Java. How do I change it to another given encoding and replace HTML-entities such as &
with &
?
This is so that international symbols can be displayed correctly.
回答1:
to decode Html String you can use Html.fromHtml()
like
Html.fromHtml((String) htmlCode).toString();
if you want reverse
than you can use TextUtils.htmlEncode()
来源:https://stackoverflow.com/questions/17643512/android-string-encoding-and-html-entities-converting