On Tue, 1 Jun 2021 18:24:05 GMT, Naoto Sato <[email protected]> wrote:
>> Maxim Kartashev has updated the pull request incrementally with two
>> additional commits since the last revision:
>>
>> - Coding style-related corrections.
>> - Corrected the test to use Platform.sharedLibraryExt()
>
> src/hotspot/os/windows/os_windows.cpp line 1491:
>
>> 1489: static errno_t convert_UTF8_to_UTF16(char const* utf8_str, LPWSTR*
>> utf16_str) {
>> 1490: return convert_to_UTF16(utf8_str, CP_UTF8, utf16_str);
>> 1491: }
>
> IIUC, `utf8_str` is the "modified" UTF-8 string in JNI. Using it as the
> standard UTF-8 (I believe Windows' encoding `CP_UTF8` is the one) may end up
> in incorrect conversions in some corner cases, e.g., for supplementary
> characters.
Right; I changed the code in NativeLibraries.c to pass down true UTF-8 instead
of "modified UTF-8". Please, take a look.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4169