String fileName = URLEncoder.encode("测试", "UTF-8").replaceAll("\\+", "%20");response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
因为http的传输都是经过编码的,所以在返回请求的时候,如果有中文必须要进行编码.
String fileName = URLEncoder.encode("测试", "UTF-8").replaceAll("\\+", "%20");response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
因为http的传输都是经过编码的,所以在返回请求的时候,如果有中文必须要进行编码.