Firstly, it generally seems to be impossible to open a file with, say, a
Chinese filename, at least on Win 2000. E.g. new FileOuputStream("中文")
generates an error such as the following:
java.io.FileNotFoundException:
C:\jbprojects\main\ekp\website\nd\fresco\uploads\??.txt (The filename,
directory name, or volume label syntax is incorrect)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
at java.io.FileOutputStream.<init>(FileOutputStream.java:62)
at java.io.FileOutputStream.<init>(FileOutputStream.java:132)
At first I thought this problem was limited to the English version of
Windows 2000, but the same problem seems to occur on Chinese Windows too.
In addition, the java.util.zip.ZipInputStream seems unable to read zip
file entries that have Chinese filenames, e.g.:
java.lang.IllegalArgumentException
at java.util.zip.ZipInputStream.getUTF8String(ZipInputStream.java:291)
at java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:230)
at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:75)
No doubt other members of this forum have come across this problem. Does
anyone have any workarounds?
IIRC, Sun has been broken for quite a long time, whereas Microsoft's VM
had no problem with this.
Back in '98 I helped write up a bug on it.
I can't find which it is off hand, since there are quite a few. Try
searching in Sun's bug database for "unicode filename". Well, some seem
to be "regressions", but still...
Too bad it looks like Sun still hasn't fixed it. :-(