Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JSON UTF-8编码截击Android_Android_Json_Utf 8_Android Volley - Fatal编程技术网

JSON UTF-8编码截击Android

JSON UTF-8编码截击Android,android,json,utf-8,android-volley,Android,Json,Utf 8,Android Volley,我对安卓和截击还不熟悉,我在link上做了一个教程。但当我解析数据库中的数据时,结果只是“替换”俄语字符。因为我是编程新手,所以无法将UTF-8添加到下面的代码中。我真的很想知道在哪里添加额外的代码,这样它可以阅读其他语言而不仅仅是英语。提前谢谢。额外的代码可以从下面提供的链接中看到 private void callNews(int页){ swipe.setRefreshing(true); //创建截击请求对象 JsonArrayRequest arrReq=新的JsonArrayRequ

我对安卓和截击还不熟悉,我在link上做了一个教程。但当我解析数据库中的数据时,结果只是“替换”俄语字符。因为我是编程新手,所以无法将UTF-8添加到下面的代码中。我真的很想知道在哪里添加额外的代码,这样它可以阅读其他语言而不仅仅是英语。提前谢谢。额外的代码可以从下面提供的链接中看到

private void callNews(int页){
swipe.setRefreshing(true);
//创建截击请求对象
JsonArrayRequest arrReq=新的JsonArrayRequest(url_列表+页面,
新的Response.Listener(){
@凌驾
公共void onResponse(JSONArray响应){
Log.d(TAG,response.toString());
if(response.length()>0){
//解析json
对于(int i=0;i偏移)
偏移量=否;
Log.d(标签“偏移量”+偏移量);
}捕获(JSONException e){
Log.e(标记“JSON解析错误:”+e.getMessage());
}
//正在通知列表适配器有关数据更改的信息
//因此,它将使用更新的数据呈现列表视图
adapter.notifyDataSetChanged();
}
}
滑动。设置刷新(假);
}
},new Response.ErrorListener(){
@凌驾
公共无效onErrorResponse(截击错误){
d(标记“Error:+Error.getMessage());
滑动。设置刷新(假);
}
});
//将请求添加到请求队列
AppController.getInstance().addToRequestQueue(arrReq);

}
适用于那些可能正在寻求相同解决方案的人。我通过将“obj.getString”更改为“news.setJudul(新字符串(obj.getString(TAG_JUDUL.getBytes)(“UTF-8”));”得到了解决方案

抱歉,巡更代码没有问题,但服务器响应。。。fx内容类型字符集与响应中使用的字符集不同,但如何修复内容类型