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]
);
}
}
}
}
}