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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content