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

Jan Lahoda jlahoda at openjdk.org
Mon May 12 13:59:11 UTC 2025


> 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.

Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision:

  Reflecting review feedback

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/25079/files
  - new: https://git.openjdk.org/jdk/pull/25079/files/42052fcb..a81e2265

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=25079&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25079&range=00-01

  Stats: 14 lines in 2 files changed: 9 ins; 0 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/25079.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25079/head:pull/25079

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


More information about the kulla-dev mailing list