Skip to content

Latest commit

 

History

History
10 lines (10 loc) · 386 Bytes

ieExcel1.md

File metadata and controls

10 lines (10 loc) · 386 Bytes

设置ie导出Excel乱码问题

String userAgent = request.getHeader("user-agent");
if (userAgent != null && userAgent.indexOf("Firefox") >= 0 || userAgent.indexOf("Chrome") >= 0
        || userAgent.indexOf("Safari") >= 0) {
    fileName= new String((fileName).getBytes(), "ISO8859-1");
} else {
    fileName= URLEncoder.encode(fileName,"UTF8"); //其他浏览器
}