Springboot 在IDEA读取properties配置文件的中文乱码问题
2018-08-07 15:41
746 查看
1、 问题描述, 在加载使用如下
@Component
@ConfigurationProperties(prefix = “com.jdjr.response”)
@PropertySource(“classpath:/config/commonConfig.properties”)
public class CommonConfig {
}
加载到的属性中存在中文, 就会乱码。
2、 问题解决:
File -> Settings -> Editor -> File Encodings
将Properties Files (*.properties)下的Default encoding for properties files设置为UTF-8,将Transparent native-to-ascii conversion前的勾选上。
3、疑问
当上述的操作都做了, 重启服务, 再次访问还是乱码
遇到这种情况请将之前创建的properties 文件删除, 在创建文件,添加属性即可。
相关文章推荐
- IDEA中properties配置文件的创建及中文乱码问题
- java获得*.properties配置文件的值,解决读取中文时乱码的问题:
- Java读取properties文件中文乱码问题解决
- Java读取properties文件中文乱码问题的解决
- Java读取properties文件中文乱码问题解决
- 关于Spring boot中读取属性配置文件出现中文乱码的问题的解决
- java读取.properties文件及解决中文乱码问题
- Java读取properties配置文件时,中文乱码解决方法
- Java读取properties配置文件时,中文乱码解决方法
- java读取*.properties配置文件时,中文乱码解决方法
- Java读取properties配置文件时,中文乱码解决方法
- SpringSecurity3 读取中文消息资源(properties)文件,输出乱码的问题
- Java读取properties配置文件时,中文乱码解决方法
- 关于properties配置文件读写,追加以及中文乱码问题
- java读取properties配置文件时中文乱码解决办法
- spring使用@Value标签读取.properties文件的中文乱码问题的解决
- java程序读取properties配置文件出现中文乱码
- 关于使用IDEA读取txt文件出现中文乱码的问题
- Java读取properties文件中文乱码问题解决
- Java读取properties文件中文乱码问题解决