The portable Java API lacks the concept of character encoding the file system, since it will not be portable: Windows, for example. saves file names as unicode regardless of language. However, on Linux, the locale LC_CTYPE your locale determines the encoding of the file system. Therefore, by exporting LC_CTYPE=en_US.utf8 or similarly to the environment before running the Java application, your application will use this to process the file names.
Also see file.encoding has no effect, the LC_ALL environment variable does this , which talks about some of the internal components behind this conversion.
source share