ppkarwasz commented on PR #602:
URL: https://github.com/apache/commons-compress/pull/602#issuecomment-2460271394

   @vincexjl,
   
   > To maintain consistency, i think need add gzipParameter.setFilenameCharset 
to resolve it.
   
   IMHO the file names should always be encoded in `UTF-8`. This would ensure:
   
   - Consistency between systems: a Gzip file created by Commons Compress on 
one system, could be read by Commons Compress on another system and the 
filename would not be mangled (as it happens today).
   - A Gzip file created by Commons Compress, would be correctly handled by 
`gunzip` on a GNU/Linux system, since file names are encoded in `UTF-8` most of 
the time and `gunzip` copies the bytes as-is from the Gzip header. Note that 
the encoding of file names does not necessarily depend on the locale: GLib for 
example uses `UTF-8` regardless of the locale (see [their 
documentation](https://docs.gtk.org/glib/character-set.html#file-name-encodings)).
   - It would be interesting to see how Windows applications handle Gzip files, 
e.g. 7-zip.
   
   To achieve that, we could switch the default file name encoding to `UTF-8` 
and provide an option (e.g. `rfcCompliance`) to restore the file name mangling 
behavior. What do you think?
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to