IntelliJ IDEA 2020.2 Help

File Encodings

File | Settings | Editor | File Encodings for Windows and Linux

IntelliJ IDEA | Preferences | Editor | File Encodings for macOS Ctrl+Alt+S the Settings/Preferences icon

If the file or directory encodings are not defined, then the project encoding is used. In case the project encoding cannot be taken (for example, when the project is not yet created), IntelliJ IDEA uses global encoding.

The file or directory encodings take precedence over the project encoding, which, in turn, takes precedence over the global encoding.

Item

Description

Global Encoding

Select the encoding to be used by default if no other encoding options are specified.

The chosen encoding will be applied, for example, when you specify settings of a default project or check out sources from a version control storage.

Choose System Default to use the default encoding of your operating system.

Project Encoding

Choose the default encoding to be used in the folders for which no encoding is appointed in the Default encoding field below.

Choose System Default to use the default encoding of your operating system.

PathThis column displays the paths to files or directories.
Default encoding

This column displays encoding for files or directories specified in Path.

If encoding is defined within a file and cannot be changed, it's shown greyed out.

If encoding is configurable, select it from the list of options.

Encoding information embedded in a file overrides the selected one; encoding information for the nested files or directories overrides that for the outer directories or the whole project.

Default encoding for properties files Specify the encoding for the properties files in your project. According to the Java API, the load(InputStream) / store(OutputStream, String) methods of the java.util.Properties class, use ISO 8859-1 encoding for input/output stream. It is advisable to use this encoding unless you have special reasons to change it. In this case, you can select the desired encoding from the list; in particular, you can use encoding defined for the whole project.
Transparent native-to-ASCII conversion

Select this option to have national characters (non-ISO 8859-1) , stored as escape sequences, shown in the property files.

If this checkbox is cleared, IntelliJ IDEA doesn't show national characters.

For more details refer toConfiguring Encoding for Properties Files.

Compare two representations of the national characters:

native to ascii conversion png
Create UTF-8 files

Use this selector to choose how IntelliJ IDEA should create UTF-8 files:

This option can be helpful if you work on an OS other than Windows and want more flexibility for the UTF-8 file encoding.

Keep in mind that the UTF-8 with BOM option may cause problems with software which is not compatible with BOM or with scripts that need to be run by an interpreter.

Last modified: 16 August 2020