The name is processed under the browser before exporting
Determine browser type, Firefox browser do special processing, otherwise the download file name garbled public static void Compatiblefilename (HttpServletRequest request, HttpServletResponse response, String excelname) throws Unsupportedencodingexception {string agent = Request.getheader (" User-agent "). toLowerCase (); Response.setcontenttype (" application/vnd.ms-excel "); String fileName = excelname; String codedfilename = Java.net.URLEncoder.encode (FileName, "UTF-8"), if (Agent.contains ("Firefox")) { Response.setcharacterencoding ("Utf-8"); Response.setheader ("Content-disposition", "attachment;filename=" + new String (Filename.getbytes (), "iso8859-1") + ". xls"); else {response.setheader ("content-disposition", "attachment;filename=" + Codedfilename + ". xls");}}
Java POI Excel Export file name is garbled