RFR: 8195129: System.load() fails to load from unicode paths [v3]

Naoto Sato naoto at openjdk.java.net
Thu Jun 3 17:54:38 UTC 2021


On Thu, 3 Jun 2021 06:59:01 GMT, Maxim Kartashev <github.com+28651297+mkartashev at openjdk.org> 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


More information about the core-libs-dev mailing list