ResourceBundle - French characters
I have a Swing application that I want to internationalize. I.E. I want to have an English resource bundle, and a French resource bundle.
I created the two resources files and I've placed them in the classpath, I then load the files like this ( for the French version ):
ResourceBundle.getBundle( "DisplayStrings", Locale.FRENCH, this.getClass().getClassLoader() );
And the resource load properly, but when I request a french string that containts French characters, the String doesn't bring over the french accent characters properly.
Is this an encoding problem? When viewed in a Text editor the French accents work fine, but when I run the application the French characters are coming across as funny garbage characters.
Does anyone have a suggestion?
Message was edited by:
bryano
[836 byte] By [
bryanoa] at [2007-11-27 7:50:40]

I've executed that native2ascii program on my properties file:
E.G. - It converted this line:
Des raccordements aux syst鑝es principaux n'ont pas pu 阾re 閠ablis.
to
Des raccordements aux syst\u00c3\u00a8mes principaux n'ont pas pu \u00c3\u00aatre \u00c3\u00a9tablis.
But when I execute the program, the characters are still not coming through properly. I end up with this string:
Des raccordements aux syst猫mes principaux n'ont pas pu 锚tre tablis.
When I extract the String from the resource bundle:
String string = resources.getString( propertykey );
the string value has the garbage characters.
I've put a breakpoint in my app to view the string right after I extract it from the resource bundle and that is where the characters are not shown properly.
And I've got this property set on the VM:
-Dfile.encoding=UTF-8
Message was edited by:
bryano
The real pain would be having to write the escape characters on your own instead of having a tool do it for you ;)
But in order to make it easier to build you application, you could use an ant buildfile to automatically take care of the conversion when a modification has been made to the properties file.