views:

20

answers:

2

Hi,

If I run the below program with the zip file which has some files with diacritic characters (e.g 1-2GF-969##JÖN.pdf) , I get IllegalArgumentException.

My application has to support all languages. So, we set encoding to UTF-8

All languages work fine. But the problem comes when reading diacritic characters.

I tried using alternatives to zip input stream, like arcmexer, but it does not support Chinese characters.

Please help me with this.

  private static void readUsingJava() {
        ZipInputStream zis;
        try {
              zis = new ZipInputStream(new FileInputStream("C:\\Check.zip"));
              ZipEntry ze;
              while ((ze = zis.getNextEntry()) != null) {
                    System.out.println("Name of the File Is  :: " + ze.getName());
              }
              zis.close();
        } catch (FileNotFoundException e) {
              e.printStackTrace();
        } catch (IOException e) {
              e.printStackTrace();
        }
  }
A: 

Hi,

This works fine with Apache commons compress and Winzip - latest version - 14.5. I tried with evaluation version of WinZIP.

We have got license for Winzip 9 only. So, Im trying to find some alternative solutions. If you know, kindly help.

Meghaladevi
You can edit your question or add a comment to add additional info. An answer is not the place for that.
Jorn
A: 

Most likely the ZIP archives you tried this with don't use UTF-8 encoding. This article should help: http://commons.apache.org/compress/zip.html

pgroke