1. 程式人生 > >IDEA 讀取 .properties檔案 中文亂碼問題 解決

IDEA 讀取 .properties檔案 中文亂碼問題 解決

場景:

我在application.properties檔案中定義了中文的鍵值,如name=你好

當我在其他類中使用@Value("${name}")  讀取配置檔案的值的時候,獲取到的值卻是亂碼。

 

解決方案:

File——>Setting——>Editor——>File  Encoding   如圖配置,我的就解決了。