Skip to content

ZipEntry does not support special characters by default since 1.1.0 #591

Description

@dlengyel-mirango

Steps to reproduce

Try to use the following code to zip a csv file with a special character ("é") in its name:

using (var zos = new ZipOutputStream(File.Create(zipPath)))
{
    ...
    zos.PutNextEntry(new ZipEntry("Téb.csv"));
    ...
}

The default value of UseUnicode changed to false since 1.1.0 when the AutomaticCodePage property was introduced in ZipEntry.cs.
Now by default codePage is -1, so UseUnicode will get a false value (as its getter uses the codePage field instead of the CodePage property).
There are workarounds (setting UseUnicode by hand or filling the IsUnicodeText property for every ZipEntry), I just wanted to let you know this issue.

Expected behavior

The zip should contain a "Téb.csv" entry.

Actual behavior

The zip contains a "TTb.csv"

Version of SharpZipLib

1.3.0

Obtained from (only keep the relevant lines)

  • Package installed using NuGet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions