title: How to add zip entry with utf-8 name to zip
body: <p>I have a method which adds inputStream to zip as an entry:</p>
  
  <pre><code>private void addToZip(InputStream is, String filename) throws Exception {
      try {
          ZipEntry zipEntry = new ZipEntry(filename);
          zos.putNextEntry(zipEntry);
          byte[] bytes = new byte[1024];
          int length;
          while ((length = is.read(bytes)) &gt;= 0) {
              zos.write(bytes, 0, length);
          }
          zos.closeEntry();
      } finally {
          IOUtils.closeQuietly(is);
      }
  }
  </code></pre>
  
  <p>The problem occurs when the filename contains an UTF-8 char like áé... In zip file it will be saved as <code>?????</code> and when I unzip it in ubuntu 12.10 it looks like: <code>N├бstroje</code> instead of <code>Nástroje</code>. </p>
  
  <p>For this example I used jdk6 but now I've also tried jdk7:</p>
  
  <pre><code>zos = new ZipOutputStream(fos, Charset.forName("UTF-8"));
  </code></pre>
  
  <p>But with no success. </p>
  
  <p>I also tried Apache Commons Zip and set encoding but also with no success. </p>
  
  <p>So how I can add this file with unicode symbols in filename to zip ?</p>