Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4459466

toString(),getDisplayLanguage() return en_IN,English in hi_IN.UTF-8 Locale of s9

XMLWordPrintable

    • beta2
    • sparc
    • solaris_9
    • Verified

      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

            sherman Xueming Shen
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: