Home > Posts > HowTo: Use DotNetZip (Ionic.Zip) library in Silverlight

HowTo: Use DotNetZip (Ionic.Zip) library in Silverlight

If you want to use the latest DotNetZip library (version 1.9.1.8) with Silverlight, you should get a patched version from http://dotnetzip.codeplex.com/workitem/14049, instead of the official download for Silverlight.

It seems the Silverlight build in 1.9.1.8 official download doesn’t work correctly, since it tries to get IBM437 Encoding (as the original ZIP spec required) from Silverlight, but that encoding is not available via Encoding.GetEncoding method in Silverlight (neither encoder and decoder fallbacks for GetEncoding are available as in .NET 4.5).

So the patched version uses Unicode encoding instead (only UTF-8 and Unicode [UTF-16] Encodings are available in Silverlight), although it could have also used a text encoding class generator for the missing encoding and change the source code similar to how Mike Taulty had done with an older version of DotNetZip.

I do prefer the Unicode approach, since using the IBM437 codepage would have issues with Unicode filenames. ZIPs with such filenames are supported fine by most modern ZIP viewers, including Windows Explorer’s Compressed Folders views in recent versions of Windows.

  1. 2014/04/22 at 19:15

    thanks for this, had the same problem in unity3d

  2. Alexander Paulouski
    2019/01/10 at 15:26

    Links are not valid no more..

    • 2019/07/11 at 06:36

      probably if you press “Download Archive” you’ll receive the source code and those patched versions (haven’t tried). Unfortunately Codeplex was shut-down and not all projects migrated. There is a chance someone had forked that project and migrated their fork say to Github, but have to search to find which one is updated.

      anyway, I was using in with ClipFlair, so see the binaries at http://github.com/zoomicon/ClipFlair to find that patched lib of DotNetZip

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: