This discussion is archived
0 Replies Latest reply: Jun 6, 2013 11:30 PM by 1013308 RSS

Java on Mac OS FileNotFound if path contatins non latin characters

1013308 Newbie
Currently Being Moderated
Good news everyone.

I found intersted problem with java on my Mac OS.

I put file with name from nonlatin characters to folder test, full path is /Users/dnelepov/Downloads/test/тест изображение.png

As u can see file exists!

Next i wrote some code to view all files on folder /Users/dnelepov/Downloads/test/ and open file for read (for example):

File dirF = new File("/Users/dnelepov/Downloads/test/");
File[] files = dirF.listFiles();
for (File oneF : files) {
System.out.println("FILE:" + oneF);
if (oneF.exists()){
But next i got this:

FILE:/Users/dnelepov/Downloads/test/�������� ����������������������.png
СБОРКА УСПЕШНО ЗАВЕРШЕНА (общее время: 0 секунд)

As you can see line EXSIS: never printed, but file founded!

Also printind system properties get:



I ask similar type question before [Java for file path with cyrillic characters|] - but i think this problem not for only Cyrillic characters - but for all non latin languages.


  • Correct Answers - 10 points
  • Helpful Answers - 5 points