博客
关于我
springmvc 上传图片中文乱码解决方案
阅读量:181 次
发布时间:2019-02-28

本文共 164 字,大约阅读时间需要 1 分钟。

在Tomcat的配置文件service.xml中,确保添加URI编码设置为UTF-8以支持多语言环境。

在Controller中,建议采取以下措施:通过将文件名转换为UTF-8字节序列来避免中文乱码问题,具体实现方法为使用fileName=new String(fileName.getBytes(),"UTF-8")进行处理。

转载地址:http://tgtj.baihongyu.com/

你可能感兴趣的文章
PAT-乙级-1040 有几个PAT
查看>>
pat1011. World Cup Betting (20)
查看>>
Spring组件扫描配置
查看>>
PAT1093 Count PAT's (25)(逻辑题)
查看>>
PATA1038题解(需复习)
查看>>
Patching Array
查看>>
Spring源码学习(二):Spring容器之prepareContext和BeanFactoryPostProcessor的介绍
查看>>
PatchMatchStereo可能会需要的Rectification
查看>>
Path does not chain with any of the trust anchors
查看>>
Path形状获取字符串型变量数据
查看>>
PAT甲级——1001 A+B Format (20分)
查看>>