From a5cf6c61b96dc5de3f342353ff090a9aec262f69 Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Sat, 6 Jul 2019 20:07:14 +0800 Subject: [PATCH] =?UTF-8?q?HttpJobHandler=E4=BC=98=E5=8C=96=EF=BC=8C?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E6=95=B0=E6=8D=AE=E6=8C=87=E5=AE=9AUTF-8?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=EF=BC=8C=E9=81=BF=E5=85=8D=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E4=B9=B1=E7=A0=81=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/XXL-JOB官方文档.md | 1 + .../executor/sample/frameless/jobhandler/HttpJobHandler.java | 2 +- .../executor/sample/jboot/jobhandler/HttpJobHandler.java | 2 +- .../executor/sample/jfinal/jobhandler/HttpJobHandler.java | 2 +- .../xuxueli/executor/sample/nutz/jobhandler/HttpJobHandler.java | 2 +- .../com/xxl/job/executor/service/jobhandler/HttpJobHandler.java | 2 +- .../com/xxl/job/executor/service/jobhandler/HttpJobHandler.java | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index 87879e44..c2871b05 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -1502,6 +1502,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段 - 15、执行器回调线程优化,回调地址为空时销毁问题修复; - 16、任务日志主键调整为long,防止海量日志情况下数据溢出; - 17、任务日志列表交互优化,操作按钮合并为分割按钮; +- 18、HttpJobHandler优化,响应数据指定UTF-8格式,避免中文乱码; ### 6.26 版本 v2.1.1 Release Notes[规划中] diff --git a/xxl-job-executor-samples/xxl-job-executor-sample-frameless/src/main/java/com/xuxueli/executor/sample/frameless/jobhandler/HttpJobHandler.java b/xxl-job-executor-samples/xxl-job-executor-sample-frameless/src/main/java/com/xuxueli/executor/sample/frameless/jobhandler/HttpJobHandler.java index c57fa6fb..a8748a88 100644 --- a/xxl-job-executor-samples/xxl-job-executor-sample-frameless/src/main/java/com/xuxueli/executor/sample/frameless/jobhandler/HttpJobHandler.java +++ b/xxl-job-executor-samples/xxl-job-executor-sample-frameless/src/main/java/com/xuxueli/executor/sample/frameless/jobhandler/HttpJobHandler.java @@ -56,7 +56,7 @@ public class HttpJobHandler extends IJobHandler { } // result - bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8")); StringBuilder result = new StringBuilder(); String line; while ((line = bufferedReader.readLine()) != null) { diff --git a/xxl-job-executor-samples/xxl-job-executor-sample-jboot/src/main/java/com/xuxueli/executor/sample/jboot/jobhandler/HttpJobHandler.java b/xxl-job-executor-samples/xxl-job-executor-sample-jboot/src/main/java/com/xuxueli/executor/sample/jboot/jobhandler/HttpJobHandler.java index e11d6683..2796ecd7 100644 --- a/xxl-job-executor-samples/xxl-job-executor-sample-jboot/src/main/java/com/xuxueli/executor/sample/jboot/jobhandler/HttpJobHandler.java +++ b/xxl-job-executor-samples/xxl-job-executor-sample-jboot/src/main/java/com/xuxueli/executor/sample/jboot/jobhandler/HttpJobHandler.java @@ -50,7 +50,7 @@ public class HttpJobHandler extends IJobHandler { } // result - bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8")); StringBuilder result = new StringBuilder(); String line; while ((line = bufferedReader.readLine()) != null) { diff --git a/xxl-job-executor-samples/xxl-job-executor-sample-jfinal/src/main/java/com/xuxueli/executor/sample/jfinal/jobhandler/HttpJobHandler.java b/xxl-job-executor-samples/xxl-job-executor-sample-jfinal/src/main/java/com/xuxueli/executor/sample/jfinal/jobhandler/HttpJobHandler.java index ae410e98..b8b61f9e 100644 --- a/xxl-job-executor-samples/xxl-job-executor-sample-jfinal/src/main/java/com/xuxueli/executor/sample/jfinal/jobhandler/HttpJobHandler.java +++ b/xxl-job-executor-samples/xxl-job-executor-sample-jfinal/src/main/java/com/xuxueli/executor/sample/jfinal/jobhandler/HttpJobHandler.java @@ -50,7 +50,7 @@ public class HttpJobHandler extends IJobHandler { } // result - bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8")); StringBuilder result = new StringBuilder(); String line; while ((line = bufferedReader.readLine()) != null) { diff --git a/xxl-job-executor-samples/xxl-job-executor-sample-nutz/src/main/java/com/xuxueli/executor/sample/nutz/jobhandler/HttpJobHandler.java b/xxl-job-executor-samples/xxl-job-executor-sample-nutz/src/main/java/com/xuxueli/executor/sample/nutz/jobhandler/HttpJobHandler.java index 434fc95f..5d2724ec 100644 --- a/xxl-job-executor-samples/xxl-job-executor-sample-nutz/src/main/java/com/xuxueli/executor/sample/nutz/jobhandler/HttpJobHandler.java +++ b/xxl-job-executor-samples/xxl-job-executor-sample-nutz/src/main/java/com/xuxueli/executor/sample/nutz/jobhandler/HttpJobHandler.java @@ -54,7 +54,7 @@ public class HttpJobHandler extends IJobHandler { } // result - bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8")); StringBuilder result = new StringBuilder(); String line; while ((line = bufferedReader.readLine()) != null) { diff --git a/xxl-job-executor-samples/xxl-job-executor-sample-spring/src/main/java/com/xxl/job/executor/service/jobhandler/HttpJobHandler.java b/xxl-job-executor-samples/xxl-job-executor-sample-spring/src/main/java/com/xxl/job/executor/service/jobhandler/HttpJobHandler.java index 159c6bea..7ccd54f2 100644 --- a/xxl-job-executor-samples/xxl-job-executor-sample-spring/src/main/java/com/xxl/job/executor/service/jobhandler/HttpJobHandler.java +++ b/xxl-job-executor-samples/xxl-job-executor-sample-spring/src/main/java/com/xxl/job/executor/service/jobhandler/HttpJobHandler.java @@ -54,7 +54,7 @@ public class HttpJobHandler extends IJobHandler { } // result - bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8")); StringBuilder result = new StringBuilder(); String line; while ((line = bufferedReader.readLine()) != null) { diff --git a/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/service/jobhandler/HttpJobHandler.java b/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/service/jobhandler/HttpJobHandler.java index 159c6bea..7ccd54f2 100644 --- a/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/service/jobhandler/HttpJobHandler.java +++ b/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/service/jobhandler/HttpJobHandler.java @@ -54,7 +54,7 @@ public class HttpJobHandler extends IJobHandler { } // result - bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8")); StringBuilder result = new StringBuilder(); String line; while ((line = bufferedReader.readLine()) != null) {