On Thu, 1 May 2025 16:55:06 GMT, Stuart Marks <sma...@openjdk.org> wrote:

>> `stdin.encoding` seems to work as intended in Windows for Japanese. (I 
>> managed to get the Windows binary of my PR) No need to change. (I wish the 
>> constructors of `InputStreamReader` and `Scanner` used `stdin.encoding` 
>> instead of UTF-8 for `System.in` by defaultI) Sorry to have bothered you.
>
> Hello @tats-u , there is no bother, I appreciate you looking at this.
> 
> The addition of `stdin.encoding` in 
> [JDK-8350703](https://bugs.openjdk.org/browse/JDK-8350703) (#24738) happened 
> very quickly. I worked with @naotoj and @AlanBateman on it and we think it 
> does the right thing, but there are many Windows configurations that we don't 
> have the opportunity to test, so more feedback is helpful.
> 
> Initially it would be good to understand if `stdin.encoding` is specified and 
> implemented correctly, and whether it provides the right behavior for 
> `java.lang.IO` in JEP 512.
> 
> In the future we can consider additional uses of `stdin.encoding` in other 
> parts of the JDK.

`InputStreamReader` and `Scanner` taking `stdin.encoding` is an interesting 
idea, but would introduce compatiblity concerns. It would have been simpler if 
we had `stdin/out/err.encoding` system properties prior to JEP 400. 
As to testing on Windows, I would like to know how the Windows `UILanguage` 
affects these, afaik we only have tested on English Windows. Say how it works 
on Japanese Windows with English system locale. However, since we have not 
changed any existing behavior (from the code wise), I don't think we would see 
any issues.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24438#discussion_r2070569424

Reply via email to