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

   > > We should probably also provide an option to decide whether to add the 
name or not.
   > 
   > Do you mean to not add the name if it cannot be encoded with the given 
Charset, or, do you mean adding an option to skip using the file name 
altogether and turn off the `FLG.FNAME` bit?
   
   To keep it simple, maybe it is best to:
   
   - [x] Introduce an option to set the character set (which you already did).
   - [ ] Introduce an option that turns off and on `FLG.FNAME` and the filename 
field. I am not sure what the default value should be. Personally I would 
prefer to have this feature **off** by default (to prevent issue reports like 
apache/logging-log4j2#1870). We could also set it to the result of 
`CharSet.canEncode()`.
   - [ ] If the filename field is enabled, use 
[`String.getBytes(CharSet)`](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#getBytes-java.nio.charset.Charset-)
 to fill it, without worrying about unmappable characters. The default behavior 
for those is:
       >This method always replaces malformed-input and unmappable-character 
sequences with this charset's default replacement byte array.
   
   


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