This is only slightly-related to Kotlin, but I don...
# gradle
d
This is only slightly-related to Kotlin, but I don’t know where to ask this otherwise; we’re on Gradle 8.1 and recently bumped our JDK from 11 to 17. Since then the compilation of Kotlin Unit Tests containing UTF-8 characters fails with
e: java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: /path/to/AuthenticationUiTest$Wenn der Zertifikat Auswählen Button geklickt und das Zertifikat bestätigt wird$1.class
on CI. I checked the
locale
on CI and it seems to be all UTF-8
Copy code
$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=
Also, I set
-Dfile.encoding=UTF-8
via
JAVA_TOOL_OPTIONS
and more recently also
-Dsun.jnu.encoding=UTF-8
, but nothing helps. It’s unviable to “fix” the issue by replacing the dangling characters everywhere, because we have dozens if not hundreds of tests that are written in native language. What else could I try out?
c
What does the full stack trace look like? What test runner & launch configuration is used? How are you using Java 17 - tool chain, default Gradle jvm, custom test settings, … What CI environment is this? Can a minimal reproducer be provided?
v
And optimally a build
--scan
if possible