一、返回数据中文乱码问题?
1、查看了项目的编码,发现没问题
2、在application.properties中设置了编码,还是不行
server:
servlet:
encoding:
charset: UTF-8
enabled: true
force: true
3、回想是执行了mvn clean install 以后出现乱码的,应该是maven编译打包时没有指定编码,在项目根pom中加入编译打包配置,发现问题解决。
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
二、properties文件注释变为了unicode编码
把这里勾选上,如果还不行就自行转换一下吧