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 {