Avi created COMPRESS-620:
----------------------------
Summary: ArchiveInputStream fails reading filenames with ANSI
characters
Key: COMPRESS-620
URL: https://issues.apache.org/jira/browse/COMPRESS-620
Project: Commons Compress
Issue Type: Bug
Components: Archivers
Affects Versions: 1.21
Reporter: Avi
I attempted to extract ANSI art packs from [SixteenColors ANSI
archive|https://github.com/sixteencolors/sixteencolors-archive] but many of
them fail.
Upon some debugging it appears that as many of the file names contain ANSI
characters which are parsed by the ArchiveInputStream as question marks, the
file fails to be saved to disk as question mark is a bad character to be had in
a filename.
Specific code:
ArchiveInputStream archiveInputStream =
archiveStreamFactory.createArchiveInputStream(ArchiveStreamFactory.ZIP,
inputStream);
ArchiveEntry archiveEntry = null;
while((archiveEntry = archiveInputStream.getNextEntry()) != null) {
Path path = Paths.get(extractDirectory, archiveEntry.getName());
example of a non parseable filename in an archive:
https://github.com/sixteencolors/sixteencolors-archive/blob/master/1992/ace-r%232.zip
A∙C∙E.ANS
Bad ZIP file example:
--
This message was sent by Atlassian Jira
(v8.20.7#820007)