StringEntity s = new StringEntity(json.toString()); s.setContentEncoding("UTF-8");
这样写,默认ISO_5598_1编码,导致出错。推荐如下写法:
StringEntity s = new StringEntity(json.toString(), “UTF-8”);
版权声明:本文为ewwerpm原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
StringEntity s = new StringEntity(json.toString()); s.setContentEncoding("UTF-8");
这样写,默认ISO_5598_1编码,导致出错。推荐如下写法:
StringEntity s = new StringEntity(json.toString(), “UTF-8”);