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

Clarify the spec wrt `useOldISOCodes` system property

XMLWordPrintable

    • b25
    • 17
    • b30

        Hebrew/Indonesian/Yiddish ISO 639 language codes failed to work in backward compatible manner even if system property java.locale.useOldISOCodes sets to true.

        Code snippet:
        import java.util.Locale;
        public class Test1 {
            public static void main(String[] args) {
                System.setProperty("java.locale.useOldISOCodes","true");
                new Test1().test();
            }
            String languages[] = new String[]{"he", "yi", "id"};
            String excepted[] = new String[]{"iw", "ji", "in"};
            private void test() {
                Locale locale = null;
                for (int i = 0; i < languages.length; i++) {
                    locale = new Locale(languages[i]);
                    if (excepted[i] != null) {
                        if (!locale.getLanguage().equals(excepted[i])) {
                            System.out.println(
                                    "getLanguage returned wrong value : "
                                            + locale.getLanguage()
                                            + " language = " + excepted[i]
                            );
                        }
                    }
                }
            }
        }

              naoto Naoto Sato
              amadgundi Asha Madgundi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: