RFR: 8259045: Exception message from saproc.dll is garbled on Windows with Japanese locale

Yasumasa Suenaga ysuenaga at openjdk.java.net
Tue Jan 5 00:43:56 UTC 2021


On Mon, 4 Jan 2021 21:06:46 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

> There are probably 25 or so places in our code where we use FormatMessage to get the error message. Are these all going to run into the same FormateMessage bug?

jdk.hotspot.agent do not have `FormatMessage()` call in other place.
Did you say about whole JDK code? I haven't checked all of them, but some code (e.g. net_util_md.c) uses `JNU_ThrowByName()` which is provided by java.dll.

> Also, it's not clear to me why you are getting garbled text in the first place. You said "Windows API might not return UTF-8 encoded string on Japanese locale." Why is that the case?

Japanese locale on Windows uses CP932., so `FormatMessage()` would return error message with Japanese chars which are encoded by CP932. It is not UTF-8.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1928



More information about the build-dev mailing list