首先这个是我的properties文件在ide中的乱码
![](https://img-blog.csdnimg.cn/img_convert/1acd104414f542304c516189f235002c.png)
我们可以注意到右下角是File Encoding:ISO-8859-1
properties文件并不都是utf-8的文件编码格式。然后,我就在读取文件的时候,当配置文件内部有中文的时候,就出现了乱码。 解决方案
在file->setting->editor->file encodings下把transparent native-to-ascll conversion勾选上就行了。
![](https://img-blog.csdnimg.cn/img_convert/3b04a402bbeeaa2fdf85737188f4d5a0.png)
![](https://img-blog.csdnimg.cn/img_convert/f084b9eae0a42036f639883c9da99747.png)
勾选一下后边的Transparent
然后就可以了