RFR: 8264208: Console charset API [v2]
naoto.sato at oracle.com
Mon Apr 12 16:41:36 UTC 2021
On 4/9/21 5:21 PM, Bernd Eckenfels wrote:
> I like the API, it is useful, however not enough to replace the defaultCharset once the Change to UTF8 is done. You still need a way to query the platforms file encoding (especially on Windows).
Initially I thought it would be beneficial to provide the method that
returns so-called `platform` charset, but I am not so sure introducing
it. The reason is that once JEP 400 is enabled, that method only serves
to migrate the old apps in the new environment. And that's where the
`COMPAT` system property would be utilized. If those apps have luxury to
make source code changes, I would recommend migrating the code by giving
the charset argument to the failing FileReader or alike.
> Also I wonder if the Javadoc needs to discuss platform aspects of console, especially System.out and LANG on unix vs. windows.
I will add some descriptions to System.out/err in relation to Console,
but how they map to platform's settings (LANG on Unix/System locale on
Windows) is an implementation detail, and I don't think it should be be
described in the spec.
> Von: security-dev <security-dev-retn at openjdk.java.net> im Auftrag von Naoto Sato <naoto at openjdk.java.net>
> Gesendet: Friday, April 9, 2021 11:06:00 PM
> An: core-libs-dev at openjdk.java.net <core-libs-dev at openjdk.java.net>; security-dev at openjdk.java.net <security-dev at openjdk.java.net>
> Betreff: Re: RFR: 8264208: Console charset API [v2]
>> Please review the changes for the subject issue. This has been suggested in a recent discussion thread for the JEP 400 [(https://mail.openjdk.java.net/pipermail/core-libs-dev/2021-March/075214.html)]. A CSR has also been drafted, and comments are welcome [(https://bugs.openjdk.java.net/browse/JDK-8264209)].
> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
> Reflected the review comments.
> - all: https://git.openjdk.java.net/jdk/pull/3419/files
> - new: https://git.openjdk.java.net/jdk/pull/3419/files/d6db04bb..8fd8f6e6
> - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3419&range=01
> - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3419&range=00-01
> Stats: 5 lines in 1 file changed: 2 ins; 0 del; 3 mod
> Patch: https://git.openjdk.java.net/jdk/pull/3419.diff
> Fetch: git fetch https://git.openjdk.java.net/jdk pull/3419/head:pull/3419
> PR: https://git.openjdk.java.net/jdk/pull/3419
More information about the core-libs-dev