RFR: 8242283: Can't start JVM when java home path includes non-ASCII character

Yasumasa Suenaga suenaga at oss.nttdata.com
Fri Apr 10 14:29:09 UTC 2020


Hi all,

Please review this change:

   JBS: https://bugs.openjdk.java.net/browse/JDK-8242283
   webrev: http://cr.openjdk.java.net/~ysuenaga/JDK-8242283/webrev.00/

After JDK-8240197 and JDK-8240725, java cannot start when java home path includes non-ASCII character e.g. Japanese Kanji.
We've discussed about this issue on JBS, and we decide to replace CP_THREAD_ACP to CP_ACP in MultiByteToWideChar() because CP_ACP works nicely rather than CP_THREAD_ACP.

But this change would not resolve in all cases. For example, Japanese encoded pathname cannot be recognized under the English system locale. It is (implicitly) described in the spec for JNI_CreateJavaVM().

https://docs.oracle.com/en/java/javase/14/docs/specs/jni/invocation.html#jni_createjavavm:
```
     char *optionString; /* the option as a string in the default platform encoding */
```


Thanks,

Yasumasa


More information about the hotspot-runtime-dev mailing list