For development, I use ResourceBundleto read the properties file of encoded UTF-8 (I installed it in the properties of the Eclipse file in this file) directly from the resource directory in the IDE (native2ascii is used on the production path), for example:
menu.file.open.label=&Öffnen...
label.btn.add.name=&Hinzufügen
label.btn.remove.name=&Löschen
Since this causes character encoding problems when using non-ASCII characters, I thought I would be happy:
ResourceBundle resourceBundle = ResourceBundle.getBundle("messages", Locale.getDefault());
String value = resourceBundle.getString(key);
value = new String(value.getBytes(), "UTF-8");
Well, this works well for the German umlauts in lower case, but not for upper ones, and ßalso does not work. Here is the value read from getString(key)and the value after converting from new String(value.getBytes(), "UTF-8"):
&Löschen => &Löschen
&Hinzufügen => &Hinzufügen
&Ã?ber => &??ber
&SchlieÃ?en => &Schlie??en
&Ã?ffnen... => &??ffnen...
The last three should be:
&Ã?ber => &Über
&SchlieÃ?en => &Schließen
&Ã?ffnen... => &Öffnen...
I suppose I'm not too far from the truth, but what am I missing here?
Google , .
EDIT: