Re: RFR: 8301119: Support for GB18030-2022 [v2]

2023-02-23 Thread Alan Bateman
On Thu, 23 Feb 2023 09:48:39 GMT, Sean Coffey wrote: > would use of jdk.internal.util.SystemProps be an option here (if having to > retrieve that value when we're at VM init level <1 ? The early startup scenario is early in the system property initialization, specifically SystemProps.Raw.

Re: RFR: 8301119: Support for GB18030-2022 [v2]

2023-02-23 Thread Sean Coffey
On Thu, 23 Feb 2023 09:03:49 GMT, Alan Bateman wrote: >> Scratch that: as it seems to be important that we don't switch after startup >> then what this code is really reaching for is `static final` field >> semantics. Since `StandardCharsets` might be loaded very early a holder >> class

Re: RFR: 8301119: Support for GB18030-2022 [v2]

2023-02-23 Thread Alan Bateman
On Thu, 23 Feb 2023 08:55:08 GMT, Claes Redestad wrote: >> `@Stable` semantics are still fuzzy to me but the rule I've adhered to is >> that back to back stores to the field - if unavoidable - needs to be >> idempotent since the JIT (or AOT) may record any non-null value as a compile >> time

Re: RFR: 8301119: Support for GB18030-2022 [v2]

2023-02-23 Thread Claes Redestad
On Thu, 23 Feb 2023 08:32:29 GMT, Claes Redestad wrote: >> `Charset` class is initialized *before* system properties are set up, in >> order to check the JNU encoding (used for file path name) is a supported >> charset or not. In some OS environments, GB18030 is the native encoding so >> we

Re: RFR: 8301119: Support for GB18030-2022 [v2]

2023-02-23 Thread Claes Redestad
On Wed, 22 Feb 2023 17:52:01 GMT, Naoto Sato wrote: >>> curious - what scenario triggers this call at initLevel < 1 ? >> >> It's not supported, but it is possible that someone might run with >> -Dfile.encoding=GB18030, in which case the default charset is used before >> the system properties

Re: RFR: 8301119: Support for GB18030-2022 [v2]

2023-02-22 Thread Naoto Sato
On Wed, 22 Feb 2023 11:34:59 GMT, Alan Bateman wrote: >> src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template line >> 217: >> >>> 215: if (VM.initLevel() < 1) { >>> 216: // Cannot get the system property yet. Assumes non-2000 >>> 217:

Re: RFR: 8301119: Support for GB18030-2022 [v2]

2023-02-22 Thread Naoto Sato
> Upgrading the GB18030 charset in the JDK to the latest 2022 standard. Since > this is not a compatible upgrade to the existing mapping, a new system > property `jdk.charset.GB18030` is introduced. If it is set to "2000", the > mapping falls back to the existing mapping based on the 2000