|
楼主 |
发表于 2020-4-12 18:15:01
|
显示全部楼层
tellyou 十分感谢,可刚才试了试你的测试代码,结果是一样的,UTF-8是八位的,肯定不行,我用了其它几种方式,还是和之前一样,输出正确,但下载项还是乱码:
<%@ page pageEncoding="GBK" contentType="application/octet-stream" %>
<% String filename=new String(("啊啊啊.jar").getBytes("GB2312"),"GBK"); %>
<%
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
response.setHeader("Content-Disposition", "attachment; filename=\""+ filename+ "\""); %>
<% out.write(65); out.write(66); %>
<% out.flush(); %>
<% System.out.println(new java.util.Date() + "/" + filename);%> |
|