修复旧版本IDEA响应乱码问题

This commit is contained in:
makejava 2021-08-30 15:19:20 +08:00
parent 78c49ab052
commit 5437558e8f
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ public final class HttpUtils {
private static String handlerRequest(HttpUriRequest request) { private static String handlerRequest(HttpUriRequest request) {
try { try {
CloseableHttpResponse response = HTTP_CLIENT.execute(request); CloseableHttpResponse response = HTTP_CLIENT.execute(request);
String body = EntityUtils.toString(response.getEntity()); String body = EntityUtils.toString(response.getEntity(), "UTF-8");
if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
Messages.showWarningDialog("连接到服务器错误!", GlobalDict.TITLE_INFO); Messages.showWarningDialog("连接到服务器错误!", GlobalDict.TITLE_INFO);
return null; return null;