android php 乱码怎么解决
android php 乱码怎么解决?
前后端交互,android+php解决乱码问题
第一种:填写对应的格式
result= EntityUtils.toString(httpResponse.getEntity()),HTTP.UTF_8);
result=new String( EntityUtils.toString(httpResponse.getEntity()).getBytes("ISO_8859_1"),HTTP.UTF_8);
第二种:使用流的形式
//通过流获取具体的内容
in = httpResponse.getEntity().getContent();
//创建缓冲区
BufferedReader br = new BufferedReader(new InputStreamReader(in));
sb = new StringBuffer();
String line = null;
while((line = br.readLine())!= null){
sb.append(line);
}
result=sb.toString();
以上就是android php 乱码怎么解决的详细内容,更多请关注毛票票其它相关文章!
热门推荐
10 财运虎年祝福语简短语
11 单亲爸爸春节祝福语简短
12 狗狗上厕所训练
13 植物种植祝福语简短
14 翻译考试祝福语朋友简短
15 个人周年庆简短祝福语
16 狗狗怎么训练
17 分别祝福语简短搞笑英文
18 生日广州男生祝福语简短