A basic I18N program from the java tutorial fails
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rami_Abramson
Posted On:   Thursday, June 19, 2003 07:46 AM

Hello, Have executed the I18N program from the java tutorial in : http://java.sun.com/docs/books/tutorial/i18n/intro/after.html import java.util.*; public class I18NSample { static public void main(String[] args) { String language; String country; if (args.length != 2) { language = new String("en"); country = new String("US"); } else { language = new String(args[0]); country = new String(args[1]); } Locale currentLocale; ResourceBundle messages; currentLocale = new Locale(language, country); messages = ResourceBundle.getBundle("MessagesBundle&qu   More>>
			
Hello,

Have executed the I18N program from the java tutorial in :
http://java.sun.com/docs/books/tutorial/i18n/intro/after.html


import java.util.*;

public class I18NSample {

static public void main(String[] args) {

String language;
String country;

if (args.length != 2) {
language = new String("en");
country = new String("US");
} else {
language = new String(args[0]);
country = new String(args[1]);
}

Locale currentLocale;
ResourceBundle messages;

currentLocale = new Locale(language, country);

messages = ResourceBundle.getBundle("MessagesBundle",
currentLocale);
System.out.println(messages.getString("greetings"));
System.out.println(messages.getString("inquiry"));
System.out.println(messages.getString("farewell"));
}
}



There are several properties files that are read by the program:
MessagesBundle.properties
MessagesBundle_de_DE.properties
MessagesBundle_en_US.properties
MessagesBundle_fr_FR.properties

Have added another props file in Spanish and another in Japanese.
The issue is that when I run the program with the spanish/japanese setting (e.g. java I18NSample es CL )
I get gibrish written and not the expected spanish or japanese characters.
Why aren't the corresponding characters printed?

Would appreciate your help.

thank you,

Rami
   <<Less

Re: A basic I18N program from the java tutorial fails

Posted By:   Zac_Jacobson  
Posted On:   Thursday, June 19, 2003 11:20 AM

It could be that your console doesn't support the character encodeing of your resourse files.
About | Sitemap | Contact