Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Java I/O libraries and CJK filenames

9 views
Skip to first unread message

Carfield Yim

unread,
Feb 16, 2003, 11:32:16 PM2/16/03
to
I've noticed that the Java I/O libraries seem to have a lot of problems
dealing with filenames in Chinese, Japanese, Korean, at least on Windows.

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?

Jon A. Cruz

unread,
May 15, 2003, 12:40:32 PM5/15/03
to
Carfield Yim wrote:
> I've noticed that the Java I/O libraries seem to have a lot of problems
> dealing with filenames in Chinese, Japanese, Korean, at least on Windows.
>

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. :-(

0 new messages