RFR: 8356165: System.in in jshell replace supplementary characters with ?? [v3]

Christian Stein cstein at openjdk.org
Mon May 19 11:08:56 UTC 2025


On Wed, 7 May 2025 10:31:02 GMT, Christian Stein <cstein at openjdk.org> wrote:

>> Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   (Attempting to) fix the test on Windows.
>
> src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java line 980:
> 
>> 978:         if (pendingBytes == null || pendingBytes.length <= pendingBytesPointer) {
>> 979:             char userChar = readUserInputChar();
>> 980:             StringBuilder dataToConvert = new StringBuilder();
> 
> Perhaps, add here the comment from the PR description for readers from the future:
> 
>> [...] when the current character is a high surrogate, peek at the next character, and if it is a low surrogate, convert both the high and low surrogates to bytes together.
> 
> The (internal) API used in the implementation doesn't express that on first sight.

Thanks for adding comments.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25079#discussion_r2095459321


More information about the kulla-dev mailing list