<i18n dev> RFR: 8274544: Langtools command's usage were garbled on Japanese Windows [v5]
Jonathan Gibbons
jjg at openjdk.java.net
Wed Nov 10 19:19:36 UTC 2021
On Mon, 1 Nov 2021 16:10:26 GMT, Ichiroh Takiguchi <itakiguchi at 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 pull request now contains five commits:
>
> - 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
I strongly dislike this proposed changeset. In my opinion, the original change that has provoked the changes here is a bad/incompatible change, and should maybe be reconsidered. The fact that a change in the Java runtime has triggered the need for so many changes in application-style code is some sort of "canary in the coalmine".
Generally, the issue is related to the fact that we wrap a PrintStream in a PrintWriter ... and, if I understand correctly, the writer ends up with the wrong character encoding. Is it possible to change PrintWriter and/or PrintStream so that the correct underlying encoding used by the PrintStream is also used by the PrintWriter. That way, all existing uses where a PrintWriter wraps a PrintStream would continue to work without any modification.
cc: @jddarcy with his CSR hat on, for the compatibility issues relating to the issue that caused the problems being addressed here.
-------------
Changes requested by jjg (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/5771
More information about the i18n-dev
mailing list