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

2025-05-22 Thread Naoto Sato
On Thu, 22 May 2025 16:39:46 GMT, Alan Bateman wrote: >> I'm confused by the actual behavior here. What might be helpful is to divide >> the discussion between a) what charsets get used for input and output, and >> b) the return value of the `charset()` method. >> >> I'm not entirely sure, but

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

2025-05-22 Thread Alan Bateman
On Thu, 22 May 2025 16:15:56 GMT, Stuart Marks wrote: >> Good point. Brought the same wording to the `charset()` method description >> for further clarification. > > I'm confused by the actual behavior here. What might be helpful is to divide > the discussion between a) what charsets get used f

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

2025-05-22 Thread Stuart Marks
On Wed, 21 May 2025 16:48:20 GMT, Naoto Sato wrote: >> src/java.base/share/classes/java/io/Console.java line 67: >> >>> 65: * stdout.encoding}, in which case read operations use the {@code >>> Charset} >>> 66: * designated by {@code stdin.encoding}. >>> 67: * >> >> `Console.charset()` stat

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

2025-05-21 Thread Naoto Sato
On Wed, 21 May 2025 06:12:18 GMT, Justin Lu wrote: >> Naoto Sato has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Reflects review comments > > src/java.base/share/classes/java/io/Console.java line 67: > >> 65: * stdout.encoding}, in whi

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

2025-05-21 Thread Volkan Yazici
On Tue, 20 May 2025 22:04:41 GMT, Naoto Sato wrote: >> test/jdk/java/io/Console/StdinEncodingTest.java line 46: >> >>> 44: * @run junit StdinEncodingTest >>> 45: */ >>> 46: public class StdinEncodingTest { >> >> AFAICT, there is no similar test (e.g., one using a mock `CharsetProvider`) >> f

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

2025-05-21 Thread Volkan Yazici
On Tue, 20 May 2025 22:04:24 GMT, Naoto Sato wrote: >> All `FileDescriptor.in` encounters in `jdk.internal.org.jline.terminal` that >> might need attention: >> >> src/jdk.internal.le/share/classes/jdk/internal/org/jline/terminal/impl/DumbTerminalProvider.java >> src/jdk.internal.le/share/classe

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

2025-05-20 Thread Justin Lu
On Tue, 20 May 2025 21:57:45 GMT, Naoto Sato wrote: >> `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 >> diff

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

2025-05-20 Thread Naoto Sato
On Tue, 20 May 2025 11:29:42 GMT, Volkan Yazici wrote: >> Naoto Sato has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Reflects review comments > > test/jdk/java/io/Console/StdinEncodingTest.java line 46: > >> 44: * @run junit StdinEncod

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

2025-05-20 Thread Naoto Sato
On Tue, 20 May 2025 19:24:16 GMT, Volkan Yazici wrote: >> Also noticed `DumbTerminalProvider::sysTerminal` calls `DumbTerminal` with >> `new FileInputStream(FileDescriptor.in)`. Later on `DumbTerminal` applies >> `encoding()` both for passed `stdin` and `std{out,err}`. In short, >> `TerminalPr

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

2025-05-20 Thread Naoto Sato
> `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