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

   I have done a couple of tests on my Windows installation to see how Windows 
applications handle the filename encoding in Gzip. My locale has a default 
`WINDOWS-1250` charset, so it is easy to spot differences from both `UTF-8` and 
`ISO-8859-1`.
   
   The behavior is highly **inconsistent**:
   
   - Windows Explorer does **not** set a filename, when it creates `*.gz` 
archive.
   - When opening an archive, Windows Explorer seems to use `ISO-8859-1` to 
decode the filename. So it **does not** use the default encoding (which is 
`WINDOWS-1250`).
   - 7-Zip on the other hand sets a filename in the `*.gz` archives it creates. 
For that it uses the default (`WINDOWS-1250`) locale.
   
   @vincexjl: does the Chinese version of Windows work differently?
   
   @garydgregory,
   
   I don't think there is  a reasonable way to handle file name encoding in the 
Gzip format. I would rather concentrate on solving the original problem, which 
was mangled file names (percent encoded).
   What do you think about:
   
   - Modifying the current logic to:
     1. Encode the filename as `ISO-8859-1`.
     2. If that can not be done just **drop** the filename field (which is 
optional anyway).
   - Adding a `Boolean` option that allows users to override the behavior 
(either force the encoding of the filename or force the removal of the filename)


-- 
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