Reading files with scandinavian characters in filename on Mac OS X.

Zaphod B <[email protected]> Fri, 4 Feb 2005 18:16:54 -0800 (PST)
Newsgroups gmane.comp.web.webobjects.admin
Message-ID <[email protected]>
Hello there,
 
I have having problems with scandinavian character support on Mac OS X.
 
I am trying to read a file with scandinavian characters in the filename with my java app. I have written a small test program to try to read the file.
 
I have on a UFS partition a directory called char and a file 3ÅØÆäö.jpg inside this directory. What my app tries to do is to open an input stream to this file:
            
String[] files = directory.list ();
File source = new File (files[0]);
System.out.println ("source name: " + source.getName ());
System.out.println ("source size: " + source.length ());
FileInputStream fis = new FileInputStream (source);
 
And this is the output:
 
source name: 3¯®.jpg
source size: 0
java.io.FileNotFoundException: 3¯®.jpg (No such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at FileNameTester.main(FileNameTester.java:71)
 
Why am i getting this FileNotFoundException? This problem does not happen on Linux or Windows. Doesn't Mac OS X support characters like these?
 
-- Additional information: --
 
I have to have the file located on a UFS partition. This is because HFS+ seems to have problems supporting files with such characters in the filenames. Example, I have this 3ÅØÆäö.jpg file on a UFS partition and when I try to cp, mv, ditto, I get Invalid argument, example:
 
cp: ./3ÅØÆäö.jpg: Invalid argument

Also, if I have a zip file, say myZip.zip, with this file inside it, and when I try to unzip it onto the HFS+ partition, i get this:
 
error:  cannot create 3ÅØÆäö.jpg
 
----
 
Why can't HFS+ support this?
 
Hope you can help. Thanks!
 
Z


		
---------------------------------
Do you Yahoo!?
 All your favorites on one personal page – Try My Yahoo!