Settings properties file to display utf-8 encoding in Intellij Idea

IDE Jan 29, 2020 Viewed 3.4K Comments 0

When developing i18n international multilingual using java, * .properties files are often used to store text in various languages. In the past, I used eclipse to enter a piece of Chinese in the properties file, and it will be automatically converted to Unicode encoding, so that the Chinese garbled problem was prevented. Intellij Idea also supports this.

By default, the properties property file displays Unicode encoding, which is very inconvenient for development. such as

title=\u4E16\u754C\u4F60\u597D

Set the properties file to display in Chinese

  • mac os

Preferences -> Editor -> File Encodings -> Check 'Transparent native-to-ascii conversion'

  • windows and Linux

File -> Setting -> Editor -> File Encodings -> Check 'Transparent native-to-ascii conversion'

Transparent native-to-ascii conversion

Click OK, Unicode will automatically switch to Chinese, so editing is more convenient.

title=世界你好

In fact, the properties file is still unicode encoded, but when it is opened in the editor, Intellij Idea converts its content into Chinese, which is very useful!

Updated Jul 06, 2020