Trifork Blog

Axon Framework, DDD, Microservices

Encoding problems with properties files and IntelliJ

November 4th, 2010 by
|

The Java platform has fantastic support for many character encodings. So it is a bit odd when you find out that regular properties files, read through the Properties class only supports the ISO-8859-1 encoding.

Contrast this with the increasing custom to use UTF-8 as default encoding for all files in a project (as configured through the pom.xml).

IntelliJ automatically picks up the pom setting. However, it also applies this to properties files. This gives some serious problems when you start to edit i.e. Wicket message texts.

Luckily you can change this setting in IntelliJ: File -> Settings, enter “encoding” in the top-left, select “File Encodings” and then set “Default encoding for properties files” to “ISO-8859-1”. Feel free to play around with the “Transparent native-to-ascii conversion” as well.

Update 2010-11-14: Wicket 1.5 bonus: rename your properties file to *.utf8.properties, and Wicket will read it with UTF8 encoding!

One Response

  1. November 4, 2010 at 11:49 by Mickaël

    I faced the same problem recently, while translating Hippo CMS in French. And my conclusion is the same conclusion : https://wiki.onehippo.com/display/CMS7/Translate+the+CMS