android http请求设置user-agent包含中文

开发中需求需要设置http的user-agent,其中包含中文,使用fiddler2抓包时发现中文部分为乱码;

解决方案:

User-Agent:new String("测试".getBytes("UTF-8"), "ISO-8859-1")


由此怀疑http协议的编解码采用的是ISO-8859-1编码;

参考方案地址:http://q.cnblogs.com/q/65869/

猜你喜欢

转载自blog.csdn.net/enjoyinwind/article/details/50680183