我正在接受GET服务。
==>回复:当我在浏览器中打开以上网址时,例如谷歌浏览器。
{ "success":"1", "data": [ { "address": "Hôtel de Ville, 75004 Paris, France", "email": "umesh.nepali@indianic.com", "username": "umeshfinal", "phone": "9033329824", "status": 0, "fld_help_id": 97979, "recieveremail": "brinda@gmail.com", "image": "http://services.defensealertdevice.com/admin/uploads/user_image/user_image_2094.png", "latitude": "48.8564817", "longitude": "2.3524133", "datetime": "2017-03-03 10:50:03.0", "alertType": 0 }, { "address": "Skíðabraut, Dalvík, Iceland", "email": "brinda@gmail.com", "username": "chil", "phone": "1234567890", "status": 0, "fld_help_id": 97981, "recieveremail": "brinda@gmail.com", "image": "http://services.defensealertdevice.com/admin/uploads/user_image/user_image_2843.png", "latitude": "65.9667", "longitude": "-18.5333", "datetime": "2017-03-03 10:34:51.0", "alertType": 4 }, } ], "message": "" }
==>响应:当我在邮件员等休息客户端中打开上面的URL时。
{ "success":"1" "data": [ { "address": "H�tel de Ville, 75004 Paris, France", "email": "umesh.nepali@indianic.com", "username": "umeshfinal", "phone": "9033329824", "status": 0, "fld_help_id": 97979, "recieveremail": "brinda@gmail.com", "image": "http://services.defensealertdevice.com/admin/uploads/user_image/user_image_2094.png", "latitude": "48.8564817", "longitude": "2.3524133", "datetime": "2017-03-03 10:50:03.0", "alertType": 0 }, { "address": "Sk��abraut, Dalv�k, Iceland", "email": "brinda@gmail.com", "username": "chil", "phone": "1234567890", "status": 0, "fld_help_id": 97981, "recieveremail": "brinda@gmail.com", "image": "http://services.defensealertdevice.com/admin/uploads/user_image/user_image_2843.png", "latitude": "65.9667", "longitude": "-18.5333", "datetime": "2017-03-03 10:34:51.0", "alertType": 4 }, } ], "message": "" }
==>我正在使用okhttp进行网络呼叫,而在okhttp中默认支持utf-8。 ==>在服务器(tomcat)端也设置utf-8。
==>我仍然得到 = \ ufffd unicode而不是特殊字符的实际unicode。]
==>我还做了像URLDecoder.decode(“string”)这样的转换过程。
==>我仍然无法获得真正的特殊字符。
==>我无法从android端或服务器端了解此问题。
答案 0 :(得分:0)
花了一个月后,我已经解决了这个问题。实际上这个问题来自服务器端。我们必须在服务器端设置元标记。
快乐编码。