当我在 android 文本视图中设置文本时,它显示 #039;
when I set text in android textview it show #039;
当我从 Web 服务调用设置一个 json 字符串并且它有一个 £ 符号时它显示 pound;
、yen;
,如果它有一个撇号 ( ' ) 它显示'
更新:
json = Empresszulu$£¥€©™
设置为 Empresszulu$£¥©&trade
,并且
don't
设置为 don#039;t
。
注意:json 来自 mysql,因此可以随时更改为任何内容。
使用这种特殊字符需要使用"UTF-8"编码。
你必须像这样编码你期望的字符:
String data = EntityUtils.toString(response.getEntity(), android.httpclient.protocol.HTTP.UTF_8);
JSONObject jsono = new JSONObject(data);
当我从 Web 服务调用设置一个 json 字符串并且它有一个 £ 符号时它显示 pound;
、yen;
,如果它有一个撇号 ( ' ) 它显示'
更新:
json = Empresszulu$£¥€©™
设置为 Empresszulu$£¥©&trade
,并且
don't
设置为 don#039;t
。
注意:json 来自 mysql,因此可以随时更改为任何内容。
使用这种特殊字符需要使用"UTF-8"编码。 你必须像这样编码你期望的字符:
String data = EntityUtils.toString(response.getEntity(), android.httpclient.protocol.HTTP.UTF_8);
JSONObject jsono = new JSONObject(data);