The tests were run on OS 10.4.9 and 10.5.2, under Java 1.5. Please try
the test on your 10.4.11 Mac and post results to the list.
I don't konw what your language setting of MacOS, but if your language
setting is English, the JVM file.encoding is MacRoman that is OK for all
characters of file name, and if language setting is another, such like
Japanese, the JVM file.encoding will be 'SJIS', so the error happened.
----- Original Message -----
From: "Greg Guerin" <email@hidden>
To: "list Java-dev" <email@hidden>
Sent: Monday, September 01, 2008 10:47 AM
Subject: Re: MacOS 10.4.11 Character problem
As a follow-up, I modified your original code and tested it.
After determining what the Unicode codes for 表示履歴.jpg were, I
then entered them into the Java source as Unicode-escaped
characters. The simple exec() of 'ditto' then worked as expected:
ditto created the zip archive.
To test the zipped data, I double-clicked "zhangh.zip" in the
Finder. It expanded the archive and named the file "表示履歴
2.jpg". Finder did this because the original file already existed,
so it renamed the output to avoid overwriting an existing file.
The tests were run on OS 10.4.9 and 10.5.2, under Java 1.5. Please
try the test on your 10.4.11 Mac and post results to the list.
Note that I changed the pathnames to use the current directory (./)
rather than an absolute path hard-wired into the source.
-- GG
- - - -
import java.io.*;
public class DittoTest
{
public static void
main( String[] args )
{
try
{
File file = new File("./\u8868\u793a\u5c65\u6b74.jpg");
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden