RFR: 8275007: Java fails to start with null charset if LC_ALL is set to certain locales [v5]

Alan Bateman alanb at openjdk.java.net
Sun Nov 14 07:26:36 UTC 2021


On Sun, 14 Nov 2021 02:23:03 GMT, Naoto Sato <naoto at openjdk.org> wrote:

>> Please review the subject fix. In light of JEP400, Java runtime can/should start in UTF-8 charset if the underlying native encoding is not supported.
>
> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fixed indentation

src/java.base/share/classes/java/lang/System.java line 2123:

> 2121:         var jnuEncoding = props.getProperty("sun.jnu.encoding");
> 2122:         if (jnuEncoding == null || !Charset.isSupported(jnuEncoding)) {
> 2123:             notSupportedJnuEncoding = jnuEncoding == null ? "null" : jnuEncoding;

I think we are nearly there. When setting notSupportedJnuEncoding then we also need to set the sun.jnu.encoding property to "UTF-8", setting it in initPhase3 is too late because the file system may be used using initPhase2.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6282


More information about the core-libs-dev mailing list