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

   @garydgregory,
   
   > I think what I'm hearing you say is, that instead of falling back to ASCII 
percent-encoded, just don't write the name at all. Is that so?
   
   > If you are saying that we should remove the ASCII-%-encoded backstop, I am 
OK with that. I've not tried it so I do not know if that breaks some tests.
   
   Certainly we should drop the `%`-encoding, since it serves no purpose other 
than RFC compliance. A mangled name is worse than no name at all and no Gzip 
decompressor handles that AFAIK.
   
   We should probably also provide an option to decide whether to add the name 
or not. Note that:
   
   - The original `gzip` utility **saves** the name upon compression, but does 
**not** restore it upon decompression.
   - Windows Explorer does **not** save the name upon compression, but 
**restores** it upon decompression (as far as I could tell).
   
   I believe that **not** storing the file name is the safest behavior, because 
in that case all applications fall back to inferring the uncompressed filename 
from the compressed filename.
   
   **Remark**: I don't know what was the motivation behind this "filename" 
feature in Gzip, but I suspect that it was useful when the `.gz` file had a 
truncated name (e.g. on DOS filesystems, where the original name is truncated). 
These days it seems to be more of a nuisance than a feature. If you compress a 
logfile `log.1` to `log.1.gz` and then rename it to `log.2.gz`, the 
uncompressed file name is not renamed.


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