On Wed, 24 Mar 2021 12:09:27 GMT, Kevin Rushforth <k...@openjdk.org> wrote:
>> The convertNSStringToJString function convert NSString to Java String using >> NewStringUTF,NewStringUTF accept modified-UTF8 encoded str。This fix using >> UTF-16 encoding for converting. > > I'll review this. The fix seems fine at first glance. With your patch it uses > a similar mechanism to the attributed string case; I'm curious why copying > the string is needed in that case, but not in this case. > > What testing have you done to ensure that this will not cause any regressions? > > Perhaps @prrace or @jperedadnr or @johanvos could be a second reviewer? I've test on macOS 11.2.3 with Chinese input method, including ascii chars, CJK chars, emojis, and inputing ascii/cjk chars+emojis together. All works as expected. The memory allocation in NSAttributedString could be eliminated either, AFAIK. I haven't tested it, do not know how to input a NSAttributedString. ------------- PR: https://git.openjdk.java.net/jfx/pull/436