https://mail.openjdk.java.net/pipermail/core-libs-dev/2021-October/082387.html
The `file.encoding` system property should be set to sprops->sun_jnu_encoding for platforms except MacOS but a regression introduced in JDK-4947890 that set its value to sprops->encoding instead.
#ifdef MACOSX
/*
* Since sun_jnu_encoding is now hard-coded to UTF-8 on Mac, we don't
* want to use it to overwrite file.encoding
*/
PUTPROP(props, "file.encoding", sprops->encoding);
#else
PUTPROP(props, "file.encoding", sprops->sun_jnu_encoding);
#endif