RFR: 8278908: [macOS] Unexpected text normalization on pasting from clipboard

Dmitry Batrak dbatrak at openjdk.java.net
Thu Dec 23 10:44:11 UTC 2021


On Thu, 16 Dec 2021 15:53:26 GMT, Dmitry Batrak <dbatrak at openjdk.org> wrote:

> The fix just removes the explicit normalization of text obtained from system clipboard in JDK code, as I've found no
> good justification for such a normalization, at least for the latest macOS version.
> The same fix was performed in JetBrains Runtime by a user's request more than 4 years ago, and we didn't receive any
> related complaints from our users ever since.

Thanks, I didn't know about that repo being available.
`CFStringNormalize` in the code is applied to filenames. Removing that explicit normalization doesn't seem to make any existing jtreg test fail (checked `dnd` and `datatransfer` ones), but I wouldn't touch it without a reason (e.g. a user reporting a problem with it). It can be related to file access API implementation, which, AFAIU, is expected to ignore the normalization form when referring to a file by its name on macOS.
After the proposed fix, filename can have a different representation in 'plain-text' and 'file-list'/'uri-list' flavors, as seen by a Java app, for a file 'copied' to clipboard e.g. from Finder, but I see no apparent problems with that.

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

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



More information about the client-libs-dev mailing list