久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      java下載亂碼解決方法

      java下載亂碼解決方法

      下載文件亂碼解決代碼:

        String userAgent = request.getHeader("User-Agent");       String formFileName = file.getFileName();                // 針對(duì)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");

      URLEncoder.encode(String s, String enc) :使用指定的編碼機(jī)制將字符串轉(zhuǎn)換為 application/x-www-form-urlencoded 格式 。

      new String(byte[],decode)方法使用指定的編碼decode來將byte[]解析成字符串。

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