String oriFileName = "我是文件名";response.setContentType("application/vnd.ms-excel");response.setCharacterEncoding("utf-8");String fileName = URLEncoder.encode(oriFileName , "UTF-8").replaceAll("\\+", "%20");response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
[踩坑系列]URLEncode 中对 空格的编码有 “+”和“%20”两种