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
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
- duplicates
-
JDK-4026754 Locale.US.getDisplayCountry() and getDisplayLanguage() returns wrong
-
- Closed
-
- relates to
-
JDK-4031804 name of "french" locale wrong
-
- Closed
-