I'm trying to internationalize my program, but I'm having some problems. The characters aren't being displayed correctly. This happens with all languages with unicode characters, not just Czech. I've tried typing the unicode characters directly into the .properties file:
WELCOMETEXT=VÃtejte do EasyForm!\n\n Je to porvé co spouatÃte EasyForm, proto potYebujete nastavit heslo pro aifrovánà a deaifrovánÃ. Toto heslo budete muset vkládat poka~dé.
I've also tried using the native2ascii program to produce this:
WELCOMETEXT=V\u00c3\u00adtejte do EasyForm!\n\n Je to porv\u00c3\u00a9 co spou\u00c5\u00a1t\u00c3\u00adte EasyForm, proto pot\u00c5\u2122ebujete nastavit heslo pro \u00c5\u00a1ifrov\u00c3\u00a1n\u00c3\u00ad a de\u00c5\u00a1ifrov\u00c3\u00a1n\u00c3\u00ad. Toto heslo budete muset vkl\u00c3\u00a1dat poka\u00c5\u00bed\u00c3\u00a9.
But whenever I run the program, I just get corrupt characters:
VÃÂtejte do EasyForm!
Je to porvé co spouÅ¡tÃÂte EasyForm, proto potÃ…"ebujete nastavit heslo pro Å¡ifrovánàa deÅ¡ifrovánÃÂ. Toto heslo budete muset vkládat pokaždé.
This is the code I'm using to create get and set the language strings:
ResourceBundle lang = ResourceBundle.getBundle("lang", new Locale("en"));
JTextPane txtWelcomeText = new JTextPane();
txtWelcomeText.setText(lang.getString("WELCOMETEXT"));
System.out.println(lang.getString("WELCOMETEXT"));
txtWelcomeText.setBackground(null);
txtWelcomeText.setEditable(false);
txtWelcomeText.setBorder(null);
welcomePage1.add(txtWelcomeText,c);
The dodgy text appears in both the console and on the JTextPane, and all of the menus and buttons in the application.
|