Unicode filename problems in linux
807605Jun 14 2007 — edited Jun 21 2007I'm running into a problem in linux (Ubuntu). The following test code will throw an exception at the "FileInputStream fis... " line with the file has a unicode filename. However, Windows passes this without problems.
try {
File dir = new File("a directory that exists");
File[] files = dir.listFiles(); //get file list
for (int i = 0; i < files.length; ++i) {
System.out.println("file " + files.getAbsolutePath());
FileInputStream fis = new FileInputStream(files[i]);
}
} catch (Exception e) {
System.out.println("Exception: " + e.getMessage());
}
Does anyone know how to fix this? Thanks!