RFR: 8283620: System.out does not use the encoding/charset specified in the Javadoc [v2]

David Holmes dholmes at openjdk.java.net
Sat Apr 23 05:58:26 UTC 2022


On Fri, 22 Apr 2022 18:14:18 GMT, Naoto Sato <naoto at openjdk.org> wrote:

>> Promoting the internal system properties for `System.out` and `System.err` so that users can override the encoding used for those streams to `UTF-8`, aligning to the `Charset.defaultCharset()`. A CSR has also been drafted.
>
> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Modified the spec for the new system properties.

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

> 772:      *     <td>Character encoding name for {@link System#out System.out}.
> 773:      *     The Java runtime can be started with the system property set to {@code UTF-8},
> 774:      *     starting it with the property set to another value clears to undefined behavior.

_leads_ to undefined behavior

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

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


More information about the core-libs-dev mailing list