Blog Archives

Wrong charset with GWT Dev-Mode in Eclipse

If you use .properties files to define the application strings, you will run into a strange behaviour of the GWT Dev-Mode in Eclipse.

All .properties files have a default charset of ISO-8859-1. You can see that on your global preferences:

eclipse-prefs

If you write your text, it will be encoded into ISO-8859-1. Now the internal Jetty sends HTTP responses with a charset ISO-8859-1, your text will be unchanged. But if the browser displays the website in UTF-8, all of your texts have the wrong charset (i.e. German umlaute will be wrong). There is no config option to change the behaviour of the Jetty, but you can set the default charset of the .properties files to UTF-8. Then the HTTP responses will change your text encoding, but the browser will change it back to the right charset (set Content-type UTF-8 within your index.html!).