소스 검색

3.1.0-改txt编码为"gb2312",浏览器访问不乱码

xiaof 2 년 전
부모
커밋
053ace4cbf

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/GradeBatchServiceImpl.java

@@ -347,7 +347,7 @@ public class GradeBatchServiceImpl extends ServiceImpl<GradeBatchMapper, GradeBa
 
                 JSONObject jsonObject = new JSONObject();
                 out = new ByteArrayOutputStream();
-                out.write(exception.getBytes(StandardCharsets.UTF_8));
+                out.write(exception.getBytes("gb2312"));
                 byte[] bookByteAry = out.toByteArray();
                 inputStream = new ByteArrayInputStream(bookByteAry);
 

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/export/AsyncExportTaskTemplete.java

@@ -93,7 +93,7 @@ public abstract class AsyncExportTaskTemplete {
             String type = (String) jsonObject.get(SystemConstant.TYPE);
 
             out = new ByteArrayOutputStream();
-            out.write(tbTask.getSummary().getBytes(StandardCharsets.UTF_8));
+            out.write(tbTask.getSummary().getBytes("gb2312"));
             byte[] bookByteAry = out.toByteArray();
             inputStream = new ByteArrayInputStream(bookByteAry);
             StringJoiner stringJoiner = new StringJoiner("");