How to use UTF-8 in resource properties with ResourceBundle

后端 未结 16 2217
难免孤独
难免孤独 2020-11-22 03:28

I need to use UTF-8 in my resource properties using Java\'s ResourceBundle. When I enter the text directly into the properties file, it displays as mojibake.

16条回答
  •  伪装坚强ぢ
    2020-11-22 03:36

    From Java 9, the default to load properties file has been changed to UTF-8. https://docs.oracle.com/javase/9/intl/internationalization-enhancements-jdk-9.htm

提交回复
热议问题