RFR: 8285517: System.getenv() returns unexpected value if environment variable has non ASCII character [v7]
Roger Riggs
rriggs at openjdk.java.net
Wed May 11 18:11:11 UTC 2022
On Mon, 9 May 2022 12:30:19 GMT, Ichiroh Takiguchi <itakiguchi at openjdk.org> wrote:
>> On JDK19 with Linux ja_JP.eucjp locale,
>> System.getenv() returns unexpected value if environment variable has Japanese EUC characters.
>> It seems this issue happens because of JEP 400.
>> Arguments for ProcessBuilder have same kind of issue.
>
> Ichiroh Takiguchi has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits:
>
> - Merge branch 'master' into 8285517
> - 8285517: System.getenv() returns unexpected value if environment variable has non ASCII character
> - 8285517: System.getenv() returns unexpected value if environment variable has non ASCII character
> - 8285517: System.getenv() returns unexpected value if environment variable has non ASCII character
> - 8285517: System.getenv() returns unexpected value if environment variable has non ASCII character
> - 8285517: System.getenv() returns unexpected value if environment variable has non ASCII character
> - 8285517: System.getenv() returns unexpected value if environment variable has non ASCII character
src/java.base/unix/classes/java/lang/ProcessEnvironment.java line 68:
> 66: private static final Map<String,String> theUnmodifiableEnvironment;
> 67: static final int MIN_NAME_LENGTH = 0;
> 68: private static final Charset jnuCharset = StaticProperty.jnuCharset();
Since the Charset is cached in StaticProperty, I don't think its worthwhile to make a local copy of the same ref.
Just refer to `StaticProperty.jnuCharset()` where it is needed. (Here and in ProcessImpl)
-------------
PR: https://git.openjdk.java.net/jdk/pull/8378
More information about the core-libs-dev
mailing list