After setting the locale to hi_IN.UTF-8 the Locale class is not returning the right values for methods toString & getDisplayLanguage().
to reproduce the problem.
import java.util.*;
public class LocaleDemo{
String result = "";
public LocaleDemo(){
Locale locale = Locale.getDefault();
System.out.println("Locale = " + locale.getDisplayLanguage() + " Country: " + locale.getDisplayCountry());
System.out.println(locale.toString());
}
public static void main(String[] args){
new LocaleDemo();
}
}
execute the above code in locale hi_IN.UTF-8 of Solaris 9.
==============================================================
Do locale -a, hi_IN.UTF-8 is one of available locales
i18n-u10-9a:/home/minchit 7 % locale
LANG=hi_IN.UTF-8
LC_CTYPE="hi_IN.UTF-8"
LC_NUMERIC="hi_IN.UTF-8"
LC_TIME="hi_IN.UTF-8"
LC_COLLATE="hi_IN.UTF-8"
LC_MONETARY="hi_IN.UTF-8"
LC_MESSAGES="hi_IN.UTF-8"
LC_ALL=hi_IN.UTF-8
i18n-u10-9a:/home/minchit 9 % java -version
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b64)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b64, mixed mode)
i18n-u10-9a:/home/minchit 10 % java LocaleDemo.^R
java LocaleDemo
Locale = English Country: India
en_IN
minchi.tien@eng 2001-05-16
to reproduce the problem.
import java.util.*;
public class LocaleDemo{
String result = "";
public LocaleDemo(){
Locale locale = Locale.getDefault();
System.out.println("Locale = " + locale.getDisplayLanguage() + " Country: " + locale.getDisplayCountry());
System.out.println(locale.toString());
}
public static void main(String[] args){
new LocaleDemo();
}
}
execute the above code in locale hi_IN.UTF-8 of Solaris 9.
==============================================================
Do locale -a, hi_IN.UTF-8 is one of available locales
i18n-u10-9a:/home/minchit 7 % locale
LANG=hi_IN.UTF-8
LC_CTYPE="hi_IN.UTF-8"
LC_NUMERIC="hi_IN.UTF-8"
LC_TIME="hi_IN.UTF-8"
LC_COLLATE="hi_IN.UTF-8"
LC_MONETARY="hi_IN.UTF-8"
LC_MESSAGES="hi_IN.UTF-8"
LC_ALL=hi_IN.UTF-8
i18n-u10-9a:/home/minchit 9 % java -version
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b64)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b64, mixed mode)
i18n-u10-9a:/home/minchit 10 % java LocaleDemo.^R
java LocaleDemo
Locale = English Country: India
en_IN
minchi.tien@eng 2001-05-16