简体   繁体   中英

when I set text in android textview it show #039;

When I set a json string from web service call and it has a £ sign it shows pound; , yen; , and if it has an apostrophe( ' ) it shows '

UPDATED: json = Empresszulu$£¥€©™ sets as Empresszulu$£¥©&trade , and don't sets as don#039;t . NOTE: the json is from mysql so it could be changed to anything anytime.

You need to use "UTF-8" encoding for using this kind of special character. You have to encode for your expected character like this way :

 String data = EntityUtils.toString(response.getEntity(), android.httpclient.protocol.HTTP.UTF_8);
 JSONObject jsono = new JSONObject(data);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM