JDK-8356985 : Use "stdin.encoding" in Console's read*() methods
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.io
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2025-05-14
  • Updated: 2025-05-30
  • Resolved: 2025-05-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 25
25 masterFixed
Related Reports
CSR :  
Causes :  
Relates :  
Description
They use "stdout.encoding" for creating a Charset for reading from the standard input. With the introduction of "stdin.encoding," they should be using the "stdin.encoding" system property.
Comments
Since yesterday we see the test java/io/Console/CharsetTest.java failing (some failures a macOS some on Linux). Example failure from macOS aarch64 : ----------System.out:(4/294)---------- [2025-05-29T20:02:22.235275Z] Gathering output for process 4143 [2025-05-29T20:02:22.327216Z] Waiting for completion for process 4143 [2025-05-29T20:02:22.343515Z] Waiting for completion finished for process 4143 Output and diagnostic info for process 4143 was saved into 'pid-4143-output.log' ----------System.err:(21/1184)---------- stdout: [spawn /priv/mytest/output_openjdk25_dev_dbgU_darwinaarch64/testee-vm/bin/java -Dstdout.encoding=ISO8859-1 -classpath /System/Volumes/Data/priv/mytest/output_openjdk25_dev_dbgU_darwinaarch64/jtreg_jdk_tier2_work/JTwork/classes/0/java/io/Console/CharsetTest.d CharsetTest Error: Unable to initialize main class CharsetTest Caused by: java.lang.NoClassDefFoundError: jtreg/SkippedException ]; stderr: [expect: spawn id exp5 not open while executing "expect eof" (file "/System/Volumes/Data/priv/mytest/output_openjdk25_dev_dbgU_darwinaarch64/jtreg/test/jdk/java/io/Console/script.exp" line 32) ] exitValue = 1 java.lang.RuntimeException: Test failed. Exit value from 'expect' command: 1 at CharsetTest.main(CharsetTest.java:69) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:565) at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:335) at java.base/java.lang.Thread.run(Thread.java:1447)
30-05-2025

Changeset: b2a61a99 Branch: master Author: Naoto Sato <naoto@openjdk.org> Date: 2025-05-28 16:24:04 +0000 URL: https://git.openjdk.org/jdk/commit/b2a61a9972493d67d0f1a9f3f529c11e45838d5b
28-05-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/25271 Date: 2025-05-16 18:11:39 +0000
17-05-2025