Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unicode filename problems in linux

807605Jun 14 2007 — edited Jun 21 2007
I'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!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 19 2007
Added on Jun 14 2007
8 comments
1,257 views