SpringBoot學習筆記(十一)--properties配置文件編碼問題

application.properties

person.last-name=小明
person.age=18
person.birth=2020/6/6
person.boss=false
person.maps.k1=v1
person.maps.k2=14
person.lists=a,b,c
person.dog.name=小狗
person.dog.age=3

properties 配置文件在 idea 中默認爲 utf-8 可能會亂碼

在這裏插入圖片描述
解決方法:

在這裏插入圖片描述
更改配置後,記得查看 application.properties 文件,其中的中文會變成亂碼,更正後重新運行測試,結果正常。

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章