RFR: 8356985: Use "stdin.encoding" in Console's read*() methods [v2]

Naoto Sato naoto at openjdk.org
Wed May 21 16:57:52 UTC 2025


On Wed, 21 May 2025 06:12:18 GMT, Justin Lu <jlu at openjdk.org> wrote:

>> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Reflects review comments
>
> src/java.base/share/classes/java/io/Console.java line 67:
> 
>> 65:  * stdout.encoding}, in which case read operations use the {@code Charset}
>> 66:  * designated by {@code stdin.encoding}.
>> 67:  * <p>
> 
> `Console.charset()` states "The returned charset is used for interpreting the input and output source (e.g., keyboard and/or display) specified by the host environment or user, which defaults to the one based on stdout.encoding." If _stdin.encoding_ is set otherwise, this is no longer true, so I think this method may need a wording update as well.

Good point. Brought the same wording to the `charset()` method description for further clarification.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25271#discussion_r2100752794


More information about the core-libs-dev mailing list