RFR: 8210199: [linux / macOS] fileChooser can't handle emojis

Jose Pereda jpereda at openjdk.java.net
Wed Apr 21 10:46:48 UTC 2021


Both `GlassDialogs.m` for macOS and `GlassCommonDialogs.c` for Linux use UTF8 encoding for the file names selected via native FileChooser, and this will fail if there are emojis in the file name.

This PR uses the same approach as in [JDK-8258381](https://bugs.openjdk.java.net/browse/JDK-8258381) for macOS, using UTF16 encoding.

For Linux, the Java `String(byte[] bytes)` constructor with default charset is used instead, preventing the need of using UTF8 encoding.

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

Commit messages:
 - Use String(bytes) instead of UTF8 encoding for filenames in Linux
 - Use UTF16 encoding for URL path in macOS

Changes: https://git.openjdk.java.net/jfx/pull/471/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jfx&pr=471&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8210199
  Stats: 15 lines in 2 files changed: 12 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jfx/pull/471.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/471/head:pull/471

PR: https://git.openjdk.java.net/jfx/pull/471


More information about the openjfx-dev mailing list