On Thu, 3 Jun 2021 06:59:01 GMT, Maxim Kartashev
<[email protected]> wrote:
>> test/hotspot/jtreg/runtime/jni/loadLibraryUnicode/LoadLibraryUnicodeTest.java
>> line 42:
>>
>>> 40: String nativePathSetting = "-Dtest.nativepath=" +
>>> getSystemProperty("test.nativepath");
>>> 41: ProcessBuilder pb =
>>> ProcessTools.createTestJvm(nativePathSetting,
>>> LoadLibraryUnicode.class.getName());
>>> 42: pb.environment().put("LC_ALL", "en_US.UTF-8");
>>
>> Some environments/user configs may not have `UTF-8` codeset on the platform.
>> May need to gracefully exit in such a case.
>
> I added `java.nio.charset.Charset.isSupported("UTF-8")` check to the test.
> Hope that's enough for the environments without `UTF-8`.
`Charset.isSupported()` returns whether Java encoder/decoder supports it or
not, not the platform has the codeset. I think we can simply limit the test
platform only to Windows in `@requires` tag in the test. Also, I would see the
test case using some supplementary characters.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4169