A quick demonstration about unicode characters in class names and the hassle on Windows.
Create following Java class file
Main.java
class Main {
public static void main(String...args) {
\u0ba4\u0bae\u0bbf\u0bb4\u0bcd.main(new String[0]);
}
}
class \u0ba4\u0bae\u0bbf\u0bb4\u0bcd {
public static void main(String[] arrstring) {
System.out.println("\u0bb5\u0ba3\u0b95\u0bcd\u0b95\u0bae\u0bcd unicode!");
}
}
All unicode characters are used with the unicode escape notation.
So actually following source would create the same class files
class Main {
public static void main(String...args) {
தமிழ்.main(new String[0]);
}
}
class தமிழ் {
public static void main(String[] args) {
System.out.println("வணக்கம் unicode!");
}
}
Compile the source (the one with the unicode escapes)
javac Main.java
this creates the class files Main.class
and தமிழ்.class
(you can check the file names e.g. with explorer .
in the same directory)
in CMD console the unicode file name cannot be shown
> dir /b *.class
Main.class
?????.class
> java Main
??????? unicode!
in ConEmu the file name is displayed correctly
> dir /b *.class
Main.class
தமிழ்.class
> java Main
??????? unicode!
even the file name தமிழ்.class
cannot be shown and accessed correctly in a CMD session, Java is able to execute the class. This means the class is stored correctly with the unicode characters. But the output is broken in both cases.
If you run the above code on a Linux machine the output will be as expected
$ java Main
வணக்கம் unicode!
edit the class with unicode characters can be executed on Linux directly
$ java தமிழ்
வணக்கம் unicode!
edit PowerShell ISE
PS > ls *.class
...
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 08/04/2018 12:34 317 Main.class
-a--- 08/04/2018 12:34 443 தமிழ்.class
PS > java Main
??????? unicode!
PS > java தமிழ்
java : Error: Could not find or load main class ?????
At line:1 char:1
+ java தமிழ்
edit Related to this bug report on Eclipse it seems it's working on Windows 10 (which I cannot verify, don't have one)