RFR: 8300819: -Dfile.encoding=Cp943C option does not work as expected since jdk18 [v2]
Ichiroh Takiguchi
itakiguchi at openjdk.org
Sun Jan 22 23:17:10 UTC 2023
> On jdk17, following testcase works fine on Linux platform.
>
> Testcase
>
> $ cat cstest1.java
> import java.nio.charset.*;
>
> public class cstest1 {
> public static void main(String[] args) throws Exception {
> Charset cs = Charset.defaultCharset();
> System.out.println(cs + ", " + cs.getClass() + ", " + cs.getClass().getModule());
> }
> }
>
>
> $ ~/jdk-17.0.6+10/bin/java -Dfile.encoding=Cp943C -showversion cstest1
> openjdk version "17.0.6" 2023-01-17
> OpenJDK Runtime Environment Temurin-17.0.6+10 (build 17.0.6+10)
> OpenJDK 64-Bit Server VM Temurin-17.0.6+10 (build 17.0.6+10, mixed mode, sharing)
> x-IBM943C, class sun.nio.cs.ext.IBM943C, module jdk.charsets
>
>
> But it does not work as expected on jdk18 and jdk21b06
>
> $ ~/jdk-18.0.2.1+1/bin/java -Dfile.encoding=Cp943C -showversion cstest1
> openjdk version "18.0.2.1" 2022-08-18
> OpenJDK Runtime Environment Temurin-18.0.2.1+1 (build 18.0.2.1+1)
> OpenJDK 64-Bit Server VM Temurin-18.0.2.1+1 (build 18.0.2.1+1, mixed mode, sharing)
> UTF-8, class sun.nio.cs.UTF_8, module java.base
> $ ~/jdk-21/bin/java -Dfile.encoding=Cp943C -showversion cstest1
> openjdk version "21-ea" 2023-09-19
> OpenJDK Runtime Environment (build 21-ea+6-365)
> OpenJDK 64-Bit Server VM (build 21-ea+6-365, mixed mode, sharing)
> UTF-8, class sun.nio.cs.UTF_8, module java.base
>
>
> Fixed result is as follows:
>
> $ java -Dfile.encoding=Cp943C -showversion PrintDefaultCharset
> openjdk version "21-internal" 2023-09-19
> OpenJDK Runtime Environment (build 21-internal-adhoc.jdktest.jdk)
> OpenJDK 64-Bit Server VM (build 21-internal-adhoc.jdktest.jdk, mixed mode, sharing)
> x-IBM943C
Ichiroh Takiguchi has updated the pull request incrementally with one additional commit since the last revision:
8300819: -Dfile.encoding=Cp943C option does not work as expected since jdk18
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/12132/files
- new: https://git.openjdk.org/jdk/pull/12132/files/9e400d60..5e7db0e0
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=12132&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=12132&range=00-01
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/12132.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/12132/head:pull/12132
PR: https://git.openjdk.org/jdk/pull/12132
More information about the core-libs-dev
mailing list