Add new comment
Java: Loading Resource Bundle File with UTF-8
You hear that UTF-8 is the gold standard in internationalization. so you prepare your JSP pages to use UTF-8 charset.
Then you get your resource bundle files(property files) to use UTF-8 encoding. Everything looks fine in your text editor.
Now you load up the pages. Every character retrieved from your resource bundles look garbled.
This is because Java loads property files using ISO 8859-1 character encoding. Resource bundle utf-8 hack comes to rescue.
Note that in JDK 1.6, you can use PropertyResourceBundle constructor to take a Reader which uses UTF-8 encoding.
Tags: java utf-8 internationalization











