From 8d3a5852a13d7f2870fba07967cd31c98004e0ee Mon Sep 17 00:00:00 2001 From: Parker Date: Sun, 13 Dec 2020 01:22:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BAExcel=20=E5=BC=BA=E5=88=B6?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/org/opsli/plugins/excel/ExcelPlugin.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opsli-plugins/opsli-plugins-excel/src/main/java/org/opsli/plugins/excel/ExcelPlugin.java b/opsli-plugins/opsli-plugins-excel/src/main/java/org/opsli/plugins/excel/ExcelPlugin.java index 323c7e3..34cc533 100644 --- a/opsli-plugins/opsli-plugins-excel/src/main/java/org/opsli/plugins/excel/ExcelPlugin.java +++ b/opsli-plugins/opsli-plugins-excel/src/main/java/org/opsli/plugins/excel/ExcelPlugin.java @@ -35,6 +35,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.nio.charset.StandardCharsets; import java.util.List; /** @@ -158,7 +159,7 @@ public class ExcelPlugin { //创建本地文件 String filePath = fileName + excelTypeEnum.getValue(); try { - fileName = new String(filePath.getBytes(), "ISO-8859-1"); + fileName = new String(filePath.getBytes(), StandardCharsets.ISO_8859_1); response.addHeader("Content-Disposition", "attachment; filename=" + fileName); return response.getOutputStream(); } catch (IOException e) {