File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes I/O and Streams and the fly likes Zipping files using ZipOutputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Zipping files using ZipOutputStream" Watch "Zipping files using ZipOutputStream" New topic

Zipping files using ZipOutputStream

Mohamed Soliman

Joined: Mar 09, 2010
Posts: 13
I've a group of files and I'm trying to zip them all in a zip file using ZipOutputStream and ZipEntry classes. Everything is ok but I've a problem with arabic file names. When any of my files is named in arabic, it is put inside the zip file succesffully but the name is corrupted. I tried encoding the file name before I put it in the ZipEntry collection but I get the same problem.

Any ides regarding encoding ZipOutputStream? or any other API that I can use to handle this issue?

best regards.
Greg Charles

Joined: Oct 01, 2001
Posts: 2968

Very interesting. It looks like this has been a longstanding problem, and not just with Arabic, but any non-ASCII file names. There seems to be a fix for it in Java 7. If you can't use Java 7 (which is still in beta I think), you might have to find another workaround.
I agree. Here's the link:
subject: Zipping files using ZipOutputStream
jQuery in Action, 3rd edition