From be765dda3ca9f0deeed290dc0bce8a2cfa40a504 Mon Sep 17 00:00:00 2001 From: wangxy <1356089412@qq.com> Date: Thu, 9 May 2024 17:11:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BB=A3=E7=A0=81=E5=9D=8F=E5=91=B3?= =?UTF-8?q?=E9=81=93=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hyp/web/controller/reward/FileRelationController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hyp-admin/src/main/java/com/hyp/web/controller/reward/FileRelationController.java b/hyp-admin/src/main/java/com/hyp/web/controller/reward/FileRelationController.java index c2b65f5..5ce85dc 100644 --- a/hyp-admin/src/main/java/com/hyp/web/controller/reward/FileRelationController.java +++ b/hyp-admin/src/main/java/com/hyp/web/controller/reward/FileRelationController.java @@ -29,6 +29,7 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.List; import java.util.Objects; @@ -99,7 +100,7 @@ public class FileRelationController extends BaseController { public void fileView(@PathVariable String fileId, HttpServletResponse response) throws IOException { String filePath = fileRelationManager.getFilePath(fileId); String fileName = fileRelationManager.getRealName(fileId); - String encodedFileName = new String(fileName.getBytes("UTF-8"),"ISO-8859-1"); + String encodedFileName = new String(fileName.getBytes(StandardCharsets.UTF_8),StandardCharsets.ISO_8859_1); InputStream in = null; OutputStream out = null; try {