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

getDisplay*() and getISO3*() methods don't work right when locale isn't en_US

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1
    • core-libs
    • None
    • generic
    • solaris_2.5.1

      When default locale is not en_US, getDisplayName(), getDisplayLanguage(),
      getDisplayCountry(), getISO3Language(), getISO3Country() for en_US locale
      do not return correct result.

      Example:

      //dpyLocale.java
      import java.text.*;
      import java.util.*;
      import java.io.*;

      public class dpyLocale {

          public static void main(String[] args) {
              new dpyLocale();
          }

          public dpyLocale() {
              Locale lc = new Locale("en", "US", "");
              System.out.println(lc.toString() + " - " + lc.getDisplayName());
              System.out.println(lc.toString() + " - " + lc.getDisplayLanguage());
              System.out.println(lc.toString() + " - " + lc.getDisplayCountry());
              System.out.println(lc.toString() + " - " + lc.getISO3Language());
              System.out.println(lc.toString() + " - " + lc.getISO3Country());
          }
      }


      % setenv LANG fr
      % java dpyLocale
      en_US - frangais (France)
      en_US - frangais
      en_US - France
      en_US - fra
      en_US - FRA

            bcbeck Brian Beck (Inactive)
            lshisunw Limin Shi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: