zoukankan      html  css  js  c++  java
  • java导出文件中文名乱码问题

    //处理中文名乱码问题
                String userAgent = request.getHeader("User-Agent");
                if(StringUtils.contains(userAgent, "Firefox")){//火狐浏览器
                    fileName = new String(fileName.getBytes("UTF-8"), "ISO-8859-1");    
                   }else{//IE,google等其他浏览器
                       fileName = URLEncoder.encode(fileName,"UTF8");
                   }
        
                response.setHeader("Content-Disposition", "attachment;fileName="+ fileName);  
  • 相关阅读:
    poj1087最大流拆点
    3月15上午的函数练习
    3月15
    3月13上午
    3月13
    3月12
    break语句
    3月11
    3月10号
    3月9号
  • 原文地址:https://www.cnblogs.com/shihaiming/p/13121411.html
Copyright © 2011-2022 走看看