我升级了我的 httpmime 包,现在我的字符串没有作为 UTF-8 发送或接收
MultipartEntityBuilder entity = MultipartEntityBuilder.create();
Charset chars = Charset.forName("UTF-8");
entity.setCharset(chars);
entity.addTextBody("some_text", some_text);
HttpPost httppost = new HttpPost(url);
httppost.setEntity(entity.build());
...and so on..
我错过了什么?我曾经构建一个 StringBody 并在 stringbody 中设置字符集,但现在已弃用,而且它似乎不起作用