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

Naoto Sato naoto at openjdk.org
Tue May 20 21:57:45 UTC 2025


> `java.io.Console` uses the charset specified by the `stdout.encoding` system property for both input and output. While this is generally sufficient, since Console is intended for interactive terminal use, some platforms allow different encodings to be configured for input and output. In such cases, using a single encoding may lead to incorrect behavior when reading from the terminal. To address this, the newly introduced system property, `stdin.encoding`, should be used specifically for input where appropriate.

Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:

  Reflects review comments

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/25271/files
  - new: https://git.openjdk.org/jdk/pull/25271/files/f2eb1ad8..ec420654

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

  Stats: 218 lines in 7 files changed: 108 ins; 93 del; 17 mod
  Patch: https://git.openjdk.org/jdk/pull/25271.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25271/head:pull/25271

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


More information about the core-libs-dev mailing list