Gelin Luo
Gelin Luo

Reputation: 14373

Intellij IDEA 2016.3 default properties file encoding doesn't work

I've set the Default encoding for properties files to "ISO-8859-1" in my Intellij IDEA 2016.3, then I create properties files, but the file encoding is still UTF-8:

enter image description here

Any idea? Or should this be an issue?

Updates:

After changed the project and system default encoding to ISO-8859-1 and then create new properties file, it is still applied with UTF-8 encoding, and I can't manually change the properties file encoding while I do be able to change encoding for other files.

Updates:

I've created an issue on youtrack:

https://youtrack.jetbrains.com/issue/IDEA-165440

Upvotes: 7

Views: 9796

Answers (1)

stefitz
stefitz

Reputation: 516

Today I faced exactly the same problem. I found a workaround to fix the affected properties files:

  1. rename the file to txt; make sure the checkbox 'Rename bound resource bundle' is unchecked (e.g. locale-en.properties -> locale_en.txt)
  2. go to -> File -> Settings -> File Encodings -> chose the renamed file in the file tree to the right
  3. You are now able to chose the new encoding from the drop-down list (e.g. ISO-8859-1)
  4. Choose 'OK' and then 'Convert' (confirm also the warning about characters that can't be converted, if a dialog shows up)
  5. Rename the file back to it's original name (e.g. locale-en.properties)
  6. If the dialog in step 4 showed up, make sure that you fix the characters which were not converted properly (in my case some of the German umlaut showed up as ? and had to be fixed manually)

Upvotes: 15

Related Questions