Jerry Jacob's Blog

UTF-8: Encoding Fix

Posted in Java/ J2EE by Jerry Jacob on December 14, 2009

I was trying to get the non-ascii characters from my property file to render correctly in my jsp file. My original property file was encoded using UTF-8 with the spanish translations for my application. While rendering the page, I was getting a few garbled text instead of pulling the proper spanish text from the property file. Here is the simple fix that I came across after researching on it for the whole day.

1. Made a copy of my original property file,, and named it
2. Run the file,, through native2ascii to convert the characters to its unicode escape form. Here is the command line for this: native2ascii -encoding UTF-8

This fix for the property file resolved my issues.

For more info, you may visit,