SpringBoot读取配置文件中文属性值而在网页显示位乱码的处理办法(非原创)

相关文章:http://www.zslin.com/web/article/detail/47

                 https://blog.csdn.net/w1014074794/article/details/71159722


我在 application.properties 中包含有中文的属性值,在程序中读取该属性的值,显示在网页上是乱码。根据网上的资料,我通过如下的设置解决了这个问题:

    1. 在 application.properties 文件中增加以下内容:

       

    2. 将 application.properties 文件的编码格式设置为 UTF-8

    3. (在IntelliJ IDEA中)设置 File Encodings 的 Transparent native-to-ascii conversion 为 true,具体操作如下:

            依次点击 File -> Settings -> Editor -> File Encodings,Properties Files (*.properties)下的Default encoding for         properties files设置为UTF-8,将Transparent native-to-ascii conversion前的勾选上。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值