title: Bad file name encoding with ZipOutputStream
body: <p>I'm using ZipOutputStream to create a zip of PDF files.
  I have a <code>Map&lt;String,byte[]&gt;</code>, the key is the name of the PDF file, the value is the content of the PDF file. The PDF file names contain French characters such as é.</p>
  
  <p>Here is my code :</p>
  
  <pre><code>ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
  BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(byteArrayOutputStream);
  ZipOutputStream zout = new ZipOutputStream(bufferedOutputStream);
  
  for(Map.Entry&lt;String, byte[]&gt; entry : files.entrySet()) {
      String fileName = entry.getKey() + ".pdf";
      fileName = new String(fileName.getBytes(), utf8);
      ZipEntry zip = new ZipEntry(fileName);
      zout.putNextEntry(zip);
      zout.write(entry.getValue());
      zout.closeEntry();
  }
  zout.close();
  zipContent = byteArrayOutputStream.toByteArray();
  </code></pre>
  
  <p>An example of the PDf file name : Clés</p>
  
  <p>Once the zip file is created, the name of my PDf file becomes this : Cl+®s</p>
  
  <p>I tried the following solutions, and they didn't work :</p>
  
  <p>Setting explicitly the encoding (I also tried with windows-1252 and ISO-8859-1) :</p>
  
  <pre><code>final Charset utf8 = Charset.forName("UTF-8");
  ZipOutputStream zout = new ZipOutputStream(bufferedOutputStream, utf8);
  ...
  fileName = new String(fileName.getBytes(), utf8);
  </code></pre>
  
  <p>Replacing the character é with the unicode :</p>
  
  <pre><code>fileName = fileName.replace("é", "\u00E9");
  </code></pre>
  
  <p>When I unzip the zip file, I did it with the built-in extractor program of Windows (double-click and extract all).</p>
  
  <p>When I unzip with 7-zip, the encoding is back to normal. I see Clés instead of Cl+®s.
  However, I need the file name to be properly displayed even without 7-zip.</p>
  
  <p>My JDK version : 8u172</p>