On Mon, 1 Nov 2021 16:10:26 GMT, Ichiroh Takiguchi <itakigu...@openjdk.org> 
wrote:

>> JEP-400 (UTF-8 by Default) was eabled on JDK18-b13.
>> After JDK18-b13, javac and some other langtool command's usage were garbled 
>> on Japanese Windows.
>> These commands use PrintWriter instead of standard out/err with PrintStream.
>
> Ichiroh Takiguchi has updated the pull request with a new target base due to 
> a merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains five additional 
> commits since the last revision:
> 
>  - 8274544: Langtools command's usage were garbled on Japanese Windows
>  - 8274544: Langtools command's usage were garbled on Japanese Windows
>  - 8274544: Langtools command's usage were garbled on Japanese Windows
>  - 8274544: Langtools command's usage were garbled on Japanese Windows
>  - Langtools command's usage were grabled on Japanese Windows

Informally, I suggest one of the following:

1.  `PrintStream(OutputStream)` and `PrintStream(OutputStream, boolean)`  
should be redefined so that they internally check if the stream arg is a 
PrintStream, in which case they use the encoding from the `PrinStream` instead 
of the default.

2. or, add new overloads for  `PrintStream(PrintStream)` and 
`PrintStream(PrintStream, boolean)`  that are defined to use the character 
encoding from the `PrintStream` arg.


I note that `PrintStream` does not expose a "getter" for the encoding. That 
seems like a bug in itself, but even without fixing that, `PrintWriter` ought 
to be able to access the encoding "behind the scenes".

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

PR: https://git.openjdk.java.net/jdk/pull/5771

Reply via email to