Web中action代码:
response.setHeader("hello", "abc大家好123");
Android端代码:
String hello=response.getHeaders("hello")[0].getValue();
System.out.println(hello);
输出结果:

如图,英文和数字都OK,中文出现乱码
------解决方案--------------------
看看web端的编码方式
------解决方案--------------------
那你android端转下gbk啊
------解决方案--------------------
这个问题 你只能自己多debug, 才能比较深的理解编码。
现在编码格式基本上用utf-8 .
------解决方案--------------------
看看web端的编码方式
用的是GBKresponse.setCharacterEncoding("GBK");
那你android端转下gbk啊
Android端改成这样么?
String hello=response.getHeaders("hello")[0].getValue();
hello=new String(hello.getBytes("GBK"));
System.out.println(hello);
输出这样:
还是乱码
可能是这样new String(hello.getBytes("gbk"),"iso8859");
可以先用浏览器试试