On Sun, 27 Apr 2025 09:12:47 GMT, Tatsunori Uchino <d...@openjdk.org> wrote:
>> Jan Lahoda has updated the pull request incrementally with seven additional >> commits since the last revision: >> >> - Merge remote-tracking branch 'origin/finalize-concise-source-files' into >> finalize-concise-source-files >> - Reverting test commit. >> >> This reverts commit 7047cf007cc7de937aa21e96125083ee92932692. >> - Fixing tests. >> - Updating copyright year. >> - Adding bug number to tests. >> - Fixing IO tests path >> - Scratch > > src/java.base/share/classes/java/lang/IO.java line 192: > >> 190: String enc = System.getProperty("stdin.encoding", ""); >> 191: Charset cs = Charset.forName(enc, StandardCharsets.UTF_8); >> 192: br = new BufferedReader(new InputStreamReader(System.in, >> cs)); > > I suspect we need to fall back to `stdout.encoding` first before UTF-8 > especially for Windows if Java does not set `stdin.encoding` automatically > when launched. I believe that after: https://github.com/openjdk/jdk/pull/24738 the `stdin.encoding` property is set when the process is connected to a console, which is probably the main case where the encoding can be detected automatically. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24438#discussion_r2062592200