-
Bug
-
Resolution: Fixed
-
P3
-
10.0.1, 11
-
b04
-
x86_64
-
os_x
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8208421 | 11.0.2 | Naoto Sato | P3 | Resolved | Fixed | b01 |
JDK-8209246 | 11.0.1 | Naoto Sato | P3 | Resolved | Fixed | b05 |
JDK-8207971 | 11 | Naoto Sato | P3 | Resolved | Fixed | b24 |
JDK: jdk 11 build 20
Env: Mac10.11, 10.12, 10.13
Setting locale steps:
Open Languages&Region, preferred languages select "Chinese, Simplified", region select "China".
Run following test on Mac 10.11, 10.12, 10.13 with zh_CN locale, but got different results.
public class Test4 {
public static void main(String[] args){
System.out.println(Locale.getDefault());
System.out.println("Format locale: " + Locale.getDefault(Locale.Category.FORMAT));
System.out.println("Display locale: " + Locale.getDefault(Locale.Category.DISPLAY));
}
}
Output:
Mac 10.11:
zh_CN_#Hans
Format locale: zh_CN_#Hans
Display locale: zh_CN_#Hans
Mac 10.12:
zh_CN_#Hans
Format locale: zh_CN_#Hans
Display locale: zh_CN_#Hans
Mac 10.13:
zh_CN_#Hans
Format locale: en_CN_#Hans
Display locale: zh_CN_#Hans
On Mac 10.13, Java format locale is "en_CN_#Hans". It seems like Java does not setting the default format locale correctly on mac10.13.
For the format locale of mac 10.11, open Language&Region-->Advanced, there is a format language selection, refer to attachment advanced_10.11.png.
But for mac 10.12 and 10.13, there is no format language selection, refer to attachment "advanced_10.13.png". It seems like mac OS uses the "Preferred languages" as the format language. Java format locale on mac 10.12 is "zh_CN_#Hans", but on 10.13 is "en_CN_#Hans".
On mac 10.13, input "locale" in the command line, the output please refer to "locale10.13.png".
I also test with JDK 10.0.1+10 with de_DE locale on mac 10.13, the format locale is "en_DE".
Env: Mac10.11, 10.12, 10.13
Setting locale steps:
Open Languages&Region, preferred languages select "Chinese, Simplified", region select "China".
Run following test on Mac 10.11, 10.12, 10.13 with zh_CN locale, but got different results.
public class Test4 {
public static void main(String[] args){
System.out.println(Locale.getDefault());
System.out.println("Format locale: " + Locale.getDefault(Locale.Category.FORMAT));
System.out.println("Display locale: " + Locale.getDefault(Locale.Category.DISPLAY));
}
}
Output:
Mac 10.11:
zh_CN_#Hans
Format locale: zh_CN_#Hans
Display locale: zh_CN_#Hans
Mac 10.12:
zh_CN_#Hans
Format locale: zh_CN_#Hans
Display locale: zh_CN_#Hans
Mac 10.13:
zh_CN_#Hans
Format locale: en_CN_#Hans
Display locale: zh_CN_#Hans
On Mac 10.13, Java format locale is "en_CN_#Hans". It seems like Java does not setting the default format locale correctly on mac10.13.
For the format locale of mac 10.11, open Language&Region-->Advanced, there is a format language selection, refer to attachment advanced_10.11.png.
But for mac 10.12 and 10.13, there is no format language selection, refer to attachment "advanced_10.13.png". It seems like mac OS uses the "Preferred languages" as the format language. Java format locale on mac 10.12 is "zh_CN_#Hans", but on 10.13 is "en_CN_#Hans".
On mac 10.13, input "locale" in the command line, the output please refer to "locale10.13.png".
I also test with JDK 10.0.1+10 with de_DE locale on mac 10.13, the format locale is "en_DE".
- backported by
-
JDK-8207971 Java does not set the default format locale correctly on mac10.13
- Resolved
-
JDK-8208421 Java does not set the default format locale correctly on mac10.13
- Resolved
-
JDK-8209246 Java does not set the default format locale correctly on mac10.13
- Resolved
- links to