3

I would like to create a directory name which contains some non-ASCII characters. For example:

File exampleDir = new File(fullPath + File.separator + "ĞÜŞİÖÇ-ğüşiöç");
exampledir.mkdir();

But this created directory name like c:\test\Ä�ÜÅ�İÖÇ-ğüşiöç instead of c:\test\ĞÜŞİÖÇ-ğüşiöç.jpg.

I tried to start the JVM with -Dfile.encoding=UTF8 but that didn't change anything.

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
Dreamcatcher
  • 798
  • 13
  • 31
  • have a look on this http://stackoverflow.com/questions/36978747/problems-in-jcifs-with-certain-non-ascii-characters – Phoenix May 17 '16 at 14:49

1 Answers1

0

The class file are not compiled with correct encoding. I can reproduce the problem:

  1. Create java source file and save it using UTF-8 encoding.
  2. Compiled it with other encoding (For example: javac -encoding ISO-8859-1 Test.java)
Beck Yang
  • 3,004
  • 2
  • 21
  • 26