久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      java文件下載亂碼解決方法

      java文件下載亂碼解決方法

      java文件下載出現(xiàn)中文亂碼解決方法:

       String userAgent = request.getHeader("User-Agent");       String formFileName = file.getFileName();                // 針對IE或者以IE為內(nèi)核的瀏覽器:       if (userAgent.contains("MSIE") || userAgent.contains("Trident")) {           formFileName = java.net.URLEncoder.encode(formFileName, "UTF-8");       } else {           // 非IE瀏覽器的處理:           formFileName = new String(formFileName.getBytes("UTF-8"), "ISO-8859-1");       }       response.setHeader("Content-disposition",String.format("attachment; filename="%s"", formFileName));       response.setContentType("multipart/form-data");        response.setCharacterEncoding("UTF-8");

      encode() 方法以指定的編碼格式編碼字符串。

      String的getBytes()方法是得到一個操作系統(tǒng)默認的編碼格式的字節(jié)數(shù)組。

      String.getBytes(String decode)方法會根據(jù)指定的decode編碼返回某字符串在該編碼下的byte數(shù)組表示。

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號