haf / DotNetZip.Semverd

Please use System.IO.Compression! A fork of the DotNetZip project without signing with a solution that compiles cleanly. This project aims to follow semver to avoid versioning conflicts. DotNetZip is a FAST, FREE class library and toolset for manipulating zip files. Use VB, C# or any .NET language to easily create, extract, or update zip files.
Other
545 stars 218 forks source link

File named "⚾" is treated as directory #218

Open reima opened 3 years ago

reima commented 3 years ago

Steps to reproduce

  1. Create a ZIP file with a file named Files/⚾ (i.e. "Files/\u26BE").
  2. Read the ZIP file with DotNetZip.
  3. Get the entry and inspect the IsDirectory property.

Example code

using (var zip = new ZipFile("test.zip", Encoding.UTF8))
{
    zip.AddEntry("Files/\u26BE", new byte[0]);
    zip.Save();
}

using (var zip = ZipFile.Read("test.zip"))
{
    ZipEntry entry = zip["Files/\u26BE"];
    Console.WriteLine("IsDirectory: " + entry.IsDirectory);
}

Expected behavior

The IsDirectory property is false.

Actual behavior

The IsDirectory property is true.

Versions