软件编程
位置:首页>> 软件编程>> java编程>> 如何解决springboot读取配置文件的中文乱码问题

如何解决springboot读取配置文件的中文乱码问题

作者:灰太狼_cxh  发布时间:2022-09-13 22:26:42 

标签:spring,boot,配置文件

在application.properties中填写中文信息,在读取该文件时会出现中文乱码问题。

比如:application.properties内容:


student.name=小康
student.age=15

如何解决springboot读取配置文件的中文乱码问题

解决方法:我用的是IDEA,首先File->settings->Code style->File Encoding

把所有的编码都设为UTF-8就好了。

如何解决springboot读取配置文件的中文乱码问题

再次运行,得出正常结果:

如何解决springboot读取配置文件的中文乱码问题

来源:https://blog.csdn.net/weixin_39220472/article/details/80193953

0
投稿

猜你喜欢

手机版 软件编程 asp之家 www.aspxhome.com