Difference in character-set reading from command line
09:32 17 Sep 2025

I am trying to compile/convert a Java program that I wrote from using the "normal" JDK (Java v24) to natively compiled code using the GraalVM (v25). The "classic" version runs fine. The native version starts up OK but then it has an issue with program arguments read-in from the command-line which are apparently in a different character set than the ones being used by the original Java application (or the filename are being dealt with differently).

The issue is triggerend by passing a filename-argument to the application (via drag-and-drop) that contains Umlauts. Both program variants echo the passed-in filename (actually the full file-path) as:

U:\Documents\Kontoausz�ge\...\Umsatz�bersicht_20250401-20250831.csv

i.e. also in the classic version the filename echoed on the console seems "garbled" (the � is actually an ü in the file system), but the classic Java version finds, opens and processes that file without any issue. The GraalVM's compiled native executable echoes the very same filename also "garbled" but then throws a FileNotFound-Exception:

java.io.FileNotFoundException: U:\Documents\Kontoausz�ge\...\Umsatz�bersicht_20250401-20250831_AT221600000100586916.csv (The system cannot find the path specified)

(Note: I left out irrelevant fractions of the path here for privacy reason and replaced them with ...).

Why is this name/path handling behavior is different? Is there an option to align the command-line character set used by the GraalVM generated native's code's with the character set being used by the JDK-based "vanilla" Java code?

Later addition - answering misc. questions:

This is on Windows 10 (all current fixes/patches/updates installed). No "VM" other than the Java VM is involved here. The actual filename/path is U:\Documents\Kontoauszüge\...\Umsatzübersicht_20250401-20250831.csv (the ...-part of the path does not contain any Umlauts or other special characters).

C:\>chcp
Active code page: 437

My Windows system region settings are "English (Switzerland)" (yes - that exists). The system's display language is "English (US)".

The drag-and-drop I mentioned is via the Windwos Explorer, the "GUI" that some respondents wanted to know about is the Windows desktop. I drag the file that I want to be processed over a command-file which then calls the java application passing the argument via %1 to the command line calling the java application (or the .exe in the GraalVM case).

java graalvm