JDK-8337603 : Change in behavior with -Djava.locale.useOldISOCodes=true
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 23
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-07-31
  • Updated: 2024-08-12
  • Resolved: 2024-08-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 24
24 b10Fixed
Related Reports
Relates :  
Description
Starting in JDK 23, the following program behaves differently when -Djava.locale.useOldISOCodes=true is set.

```
import java.util.List;
import java.util.Locale;

class T {
  public static void main(String[] args) {
    for (String l : List.of("iw", "fa", "iw")) {
      Locale locale = new Locale(l);
      Locale.setDefault(locale);
      String displayName = locale.getDisplayName();
      System.err.println(locale);
      System.err.println(displayName);
      System.err.println(Character.getDirectionality(displayName.charAt(0)));
    }
  }
}
```

$ java -fullversion
openjdk full version "22.0.2+9-70"
$ java -Djava.locale.useOldISOCodes=true T
iw
עברית
1
fa
فارسی
2
iw
עברית
1

$ java -fullversion
openjdk full version "23-ea+34-2361"
$ java -Djava.locale.useOldISOCodes=true T
iw
Hebrew
0
fa
فارسی
2
iw
Hebrew
0
Comments
Changeset: d19ba81c Branch: master Author: Naoto Sato <naoto@openjdk.org> Date: 2024-08-07 15:58:03 +0000 URL: https://git.openjdk.org/jdk/commit/d19ba81ce12a99de1114c1bfe67392f5aee2104e
07-08-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/20474 Date: 2024-08-06 00:50:48 +0000
06-08-2024

Regression caused by JDK-8174269
01-08-2024