在我的 Android 应用程序中,我从 PHP url 获取 JSON 响应字符串。从回复中我得到了一些酒店名称apostrophe
, I get '
字符而不是apostrophe
。如何在android中解析带有特殊字符的酒店?I can see the apostrophe in the browser but could not see in android logcat.
我努力了jresponse = URLEncoder.encode(jresponse,"UTF-8");
但我无法得到apostrophe
为酒店名称。
这是响应中的酒店名称之一。
I see the following in browser.
{"id":12747,
"name":"Oscar's",
....
}
But in the logcat:
id 12747
name Oscar's
Use the decoder http://developer.android.com/reference/java/net/URLDecoder.html而不是编码器。URLDecoder.decode(jresponse,"UTF-8")
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)