From: Christian S. <chr...@sc...> - 2005-12-07 08:38:20
|
Hi Mr. Bourges-Sevenier, in fact, CP437 should be used. However, there's been a long discussion about this and the outcome is that jazzlib's objective is to provide as much compatibility to the J2SE API as possible. This means in this case that UTF-8 must be used because Sun has once decided to do so - this is a well known bug by the way. If you would like to try another library which addresses this (and many other) restrictions of the genuine java.util.zip package, then please have a look at my TrueZIP project at http://truezip.dev.java.net . Its low level API is backwards compatible to java.util.zip and provides many extensions like a selectable character encoding and the high level API makes working with ZIP files redundant by providing a drop-in replacement for the classes File, FileInputStream, FileOutputStream and others which treat ZIP files like directories in the pathname (a virtual ZIP file system). With best regards, Christian Schlichtherle --- Schlichtherle IT Services Wittelsbacherstr. 10a 10707 Berlin Tel: 030 / 34 35 29 29 Mobil: 0173 / 27 12 470 mailto:chr...@sc... http://www.schlichtherle.de <http://www.schlichtherle.de/> _____ From: jaz...@li... [mailto:jaz...@li...] On Behalf Of Mikael Bourges-Sevenier Sent: Wednesday, December 07, 2005 7:57 AM To: jaz...@li... Subject: [Jazzlib-developers] [bug] Jazzlib and codepages Dear All, In ZipFile.java and ZipInputStream.java, there is a bug when reading file names. On WinXP, one must use codepage Cp850 (PC Latin-1 codepage). So you should replace: String name = new String(buffer); by String name = new String(buffer,"Cp850"); However, I wonder if there is any indication in the zip spec about the codepage used to encode filename so it would be more generic than using Cp850. How does it sound? Kind regards, Mike |