On Tue, 25 Feb 2025 15:24:39 GMT, Oliver Schmidtmer <oschmidt...@openjdk.org> wrote:
>> Windows programs may reuse a clipboard buffer that is larger than the new >> content. In this case de NUL terminator is not at the end of the buffer, but >> within it. >> The current implementation copys the whole buffer into a text field, >> including the NUL terminator and the remaining chars. >> >> The JIRA ticket contains a JNA based sample program, which prefills the >> buffer for demonstrating this issue. >> If this should be added as a unit test, I'm open for advice how to do that. > > Oliver Schmidtmer has updated the pull request incrementally with one > additional commit since the last revision: > > check both UTF16 bytes That's a good question. If Windows does provide the information, then it would be best to use it. If not, maybe it would be better to move this check in the native code anyway, so that the Java code could just use the returned byte array? ------------- PR Comment: https://git.openjdk.org/jfx/pull/1724#issuecomment-2685441855