Question

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.

Was it helpful?

Solution 3

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

OTHER TIPS

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.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top