RFR: 8300819: -Dfile.encoding=Cp943C option does not work as expected since jdk18 [v2]
Alan Bateman
alanb at openjdk.org
Mon Jan 23 07:51:05 UTC 2023
On Sun, 22 Jan 2023 23:17:10 GMT, Ichiroh Takiguchi <itakiguchi at openjdk.org> wrote:
>> 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
I'm trying to understand what the real issue is. The java.base module on Linux builds includes SJIS, MS932, and PCK. Is there a Linux configuration in Japanese environments where the default charset in any JDK release is IBM943C? Same question for AIX builds that is the only build that includes IBM943C in java.base.
-------------
PR: https://git.openjdk.org/jdk/pull/12132
More information about the core-libs-dev
mailing list