开发者

How to Decode String in Android?

开发者 https://www.devze.com 2023-03-28 11:10 出处:网络
I have a parser module in my application which will parse the response from a webservice and give the tag value. The tag value contains some special characters like ® etc. The problem is I could n

I have a parser module in my application which will parse the response from a webservice and give the tag value. The tag value contains some special characters like ® etc. The problem is I could not decode the special characters to normal string. please find the sample re开发者_如何学Csponse string below,

Apple® iPad™ Case

Please some body help me to solve this problem.


Just Use String result = URLDecoder.decode(string, "UTF-8");

Or use this

byte[] data = Base64.decode(base64, Base64.DEFAULT);
String text = new String(data, "UTF-8");


Use something like this

String decodedString = URLDecoder.decode(your string, "UTF-8");
0

精彩评论

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