<分区>
在 javax.ws.rs.core.Response.ResponseBuilder 中,当我使用波兰语(德语、法语等)国家字符设置文件名时,它会在响应发送到客户端之前更改文件名:
ResponseBuilder response = Response.ok(file);
response.header("Content-Disposition", "attachment; filename=żółty.txt");
在此之后,文件被下载为“-óBty.txt”。如何解决这个问题?
编辑: 整个应用程序可以正常使用 UTF-8(例如 json 内容包含波兰语字符)。只有 http header 没有。