The following code makes a zip archive with a non-ASCII filename
entry. Then it reads the zip archive, and tries to recover the entry.
This is not possible, it seems. The file has now a weird encoded name.

It seems to me that with all problems zip archives have with Unicode,
the filename handling should at least be consistent between reading
and writing on the same machine.

Thanks for any hints, suggestions, or answers.

RG

---- snip ----

        TextView tv=(TextView)this.findViewById(R.id.text);

        try
        {
            BufferedOutputStream out=
                new BufferedOutputStream(
                        new   FileOutputStream("/sdcard/test.zip"),
8*1024);
            ZipOutputStream zip=new ZipOutputStream(out);

            ZipEntry ze=new ZipEntry("testäö.txt");
            zip.putNextEntry(ze);
            zip.write('a');
            zip.closeEntry();
            zip.close();

            ZipFile zf=new ZipFile(new File("/sdcard/test.zip"));
            Enumeration en=zf.entries();
            tv.setText("");
            while (en.hasMoreElements())
            {
                ze=(ZipEntry)en.nextElement();
                tv.append("\n"+ze.getName());
            }
            zf.close();

        }
        catch (Exception e)
        {
            e.printStackTrace();
        }

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to