Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
10 lines (10 sloc) 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"); //其他浏览器
}
You can’t perform that action at this time.