RFR: 8356245: stdin.encoding and stdout.encoding in jshell don't respect console code pages [v3]

Jan Lahoda jlahoda at openjdk.org
Thu May 22 12:04:12 UTC 2025


> JShell, by default, uses two processes: the main one which compiles snippets, and a remote, that runs them.
> 
> The remote process is not connected to console, and hence its in/out/err encoding will be derived from the platform encoding, while the main process will use encoding derived from the console settings.
> 
> This PR proposes to pass the stdin/out/err encoding from the main process to the remote process. It also has to change the char->byte conversion for System.in to use the `stdin.encoding`, so that the remote process understands it.
> 
> The `InputUITest` requires explicitly setting encoding, as the tests sometimes run with the ASCII encoding, but use Unicode characters, and fail, as the ASCII encoding is not really followed by JShell now.

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

  Use stdin.encoding to read from System.in.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/25328/files
  - new: https://git.openjdk.org/jdk/pull/25328/files/9d32c791..864a9dca

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

  Stats: 9 lines in 1 file changed: 5 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/25328.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25328/head:pull/25328

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


More information about the kulla-dev mailing list