How to use UTF-8 in resource properties with ResourceBundle

后端 未结 16 2249
难免孤独
难免孤独 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:54

    Open the Settings / Preferences dialog (Ctrl + Alt + S), then click Editor and File Encodings.

    Screenshot of window shown

    Then, on the bottom, you will fing default encodings for properties files. Choose your encoding type.

    Alternatively you can use unicode symbols instead of text in your resource bundle (for example "ів" equals \u0456\u0432)

提交回复
热议问题