title: Minizip and Unicode for filenames
body: <p>I'm trying to compress files with non ASCII file names with <a href="http://www.winimage.com/zLibDll/minizip.html" rel="nofollow noreferrer">Minizip</a>. If a file with a troublesome file name, that is a name with at least one charactar that is not in ASCII is compressed, the name of the file in the archive is messed up. I red <a href="https://stackoverflow.com/questions/14625784/how-to-convert-minizip-wrapper-to-unicode">How to convert minizip wrapper to unicode?</a> and changed the source code so that flag 11 is set to true but it made no different.</p>
  
  <p>An example to illustrate the problem:</p>
  
  <p>The file <code>中文</code> is named <code>S+í¦vt</code> in the zip archive.</p>
  
  <p>Or in hex: </p>
  
  <p><code>\x53\x2B\xA1\xB5\xFB\xE7</code> to <code>\x53\x2b\xed\xa6\x76\x74</code>
  The first two hexs are the same but not the last four.  <code>\x53\x2b\xed\xa6\x76\x74</code> is <code>S+í¦vt</code> in <code>window 1252</code></p>
  
  <p>The file name in the program is hard coded to <code>\x53\x2B\xA1\xB5\xFB\xE7</code>(中文) to remove the risk that the input is incorrect.</p>
  
  <p>Files with only ASCII characters in their file name are named as they should in the zip archive. On the ground that the name of the file in the zip archive is longer the the original file name , I made the assumption that another encoding then UTF-8 is used.</p>
  
  <p>Since all symbols in a computers are in fact only binary strings, I hope that one hex string will output the correct file name. The problem here is that I do not know how the file names are encoded in a zip archive. </p>
  
  <p>Does anyone have a clue how to do the translation from hex/UTF-8to the correct one and which encoding that are used? </p>
  
  <p>I think the zip archive used the OS standard encoding which in my case is Windows-1252.</p>
  
  <pre><code> const char kChineseSampleText[] = "\x53\x2B\xA1\xB5\xFB\xE7";
  
   if ( open_file( zipF, kChineseSampleText ) )
   {
       //write to file
   }
  
  
  
   bool open_file( const zipFile zipFile, const char* fileName)
   {
       zip_fileinfo zfi;
       int status = zipOpenNewFileInZip( zipFile, fileName , NULL, &amp;zfi, NULL, 0, NULL, 0, Z_DEFLATED,  Z_DEFAULT_COMPRESSION );
  
        if( status != ZIP_OK ) 
        {     
             zipClose( zipFile, NULL ); 
             return false;
        } 
        true;
   }
  </code></pre>