Integrated: 8356165: System.in in jshell replace supplementary characters with ??

Jan Lahoda jlahoda at openjdk.org
Tue May 20 06:07:01 UTC 2025


On Wed, 7 May 2025 06:44:54 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> When reading from `System.in` in a JShell snippet, JShell first reads the whole line (getting a `String`), and then converts this characters from this `String` to bytes on demand. But, it does not convert multi-surrogate code points correctly, it tries to convert each surrogate separately, which cannot work.
> 
> The proposal herein is to, 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.

This pull request has now been integrated.

Changeset: e961b13c
Author:    Jan Lahoda <jlahoda at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/e961b13cd68bc352b86af17c7e53df8537519beb
Stats:     92 lines in 3 files changed: 88 ins; 0 del; 4 mod

8356165: System.in in jshell replace supplementary characters with ??

Reviewed-by: cstein, asotona

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

PR: https://git.openjdk.org/jdk/pull/25079


More information about the kulla-dev mailing list