Possible duplicate:
How to use UTF-8 in resource properties with ResourceBundle
I want to enable the internationalization of a Java Swing application. I use the package file to keep all tags in it.
As a test, I tried to set the Swedish title to JButton . Therefore, in the package file, I wrote:
nextStepButton=nästa
And in Java code, I wrote:
nextStepButton.setText(bundle.getString("nextStepButton"));
But button header characters are not displayed correctly at runtime:

I am using a Tahoma font that supports Unicode. When I set the button name manually through the code, it looks fine:
nextStepButton.setText("nästa");
Any idea why this fails in the bundle file?
--------------------------------------------> Edit: header encoding:
I tried to encode the text coming from the package file using the code:
nextStepButton.setText(new String(bundle.getString("nextStepButton").getBytes("UTF-8")));
And still the result:

java swing internationalization mojibake resourcebundle
Brad
source share