Skip to content

the zip file with '\\' in it's entry.Key make error when run in linux #1115

@jackletter

Description

@jackletter

Although the zip specification stipulates that file path names should use '/' as the separator, there are still non-compliant writes that can cause issues when extracting on Linux. Could we consider uniformly replacing '' with '/' after decoding?

Additional note: I tried implementing the replacement in the CustomDecoder, but if the zip file specifies an encoding, SharpCompress won't invoke the CustomDecoder, preventing me from making the corrections.

        if (Flags.HasFlag(HeaderFlags.Efs))
        {
            Name = ArchiveEncoding.DecodeUTF8(name);
            Comment = ArchiveEncoding.DecodeUTF8(comment);
        }
        else
        {
            Name = ArchiveEncoding.Decode(name);
            Comment = ArchiveEncoding.Decode(comment);
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions