解决:The Unicode character [学] at code point [23,398] cannot be encoded as it is outside the permi..问题
解决The Unicode character [学] at code point [23,398] cannot be encoded as it is outside the permitted range of 0 to 255问题
文章共153字 · 阅读需要大约1分钟
一键AI生成摘要,助你高效阅读
问答
·
问题:在导出Excel表格的时候,前台正常执行导出操作,但后台出现The Unicode character [学] at code point [23,398] cannot be encoded as it is outside the permitted range of 0 to 255报错日志,且导出的Excel表格名称不是代码中定义的"学生"
原因:在代码点[23,398]处的Unicode字符[学]不能被编码,因为它超出了0到255的允许范围
解决:在出现中文的地方加上 URLEncoder.encode("学生.xlsx","UTF-8") 即可
response.setHeader("Content-Disposition","attachment;filename="+ URLEncoder.encode("学生.xlsx","UTF-8"));
更多推荐
已为社区贡献6条内容
所有评论(0)