GWT validation framework internationalization, wrong code page

165 views Asked by At

This one is related to my previous post. My problem is that after I put messages in ValidationMessages.properties in languages other than English (Ukrainian and Czech in my case) I got messed up characters in the end. The encoding of all those ValidationMessages.properties files in the bundle is UTF-8, the same as I use for the other translations, and those work well.

3

There are 3 answers

0
Vic On BEST ANSWER

I don't know what exactly solved the problem, but as I moved from the GWT Validation to the Hibernate Validation libraries it helped.

0
Vic On

After taking a look on the Hibernate Validation library and its contents I noticed that there are default translations for languages like Czech and Hungarian and they use JavaScript Unicode notation (like \u0000) for special characters. Looks ugly but works.

0
David Levesque On

I had a similar issue when reading UTF-8 properties files server-side using the ResourceBundle class. Java assumes that properties files are ISO-8859-1, while GWT assumes they are UTF-8. Oddly enough, there is no "one liner" way to tell java to read it as UTF-8. I ended up implementing this solution for reading it server-side and it works well for me, despite it not being as simple as one would hope.