Setting -Dfile.encoding is ignored for Extended Encoding Set like Cp943C (x-IBM943C) on JDK 11

Solution Verified - Updated -

Issue

Setting -Dfile.encoding is ignored on OpenJDK11 if it is set Extended Encoding Set.

For example, the behavior of the following code is changed between OpenJDK8 and OpenJDK11:

import java.nio.charset.Charset;

public class Main {
    public static void main(String[] args) {
        System.out.println(Charset.defaultCharset().name());
    }
}

Results:

// on JDK8
$ java -Dfile.encoding=x-IBM943C Main
x-IBM943C

// on JDK11
$ java -Dfile.encoding=x-IBM943C Main
UTF-8

Environment

  • OpenJDK
    • 11

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In