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

Naoto Sato naoto at openjdk.java.net
Fri Apr 22 18:14:19 UTC 2022


On Fri, 22 Apr 2022 09:31:19 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> 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 780:
> 
>> 778:      *     The property may be set on the command line to the value
>> 779:      *     {@code UTF-8}. Setting the property to a value other than {@code UTF-8}
>> 780:      *     leads to unspecified behavior.
> 
> I think the proposal to introduce two standard properties is good and is consistent with the recently introduced native.encoding. I'm not 100% sure that the sentence "The property may be set on the command line ..." is appropriate for the spec of standard properties. We got away with that for file.encoding in implNote but that isn't spec. I think we may have to replace this with something that says that the Java runtime can be started with the system property set to "UTF-8", starting it with the property set to another value clears to undefined behavior.

Thanks, Alan. Modified them as suggested.

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

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


More information about the core-libs-dev mailing list