Implement ZIP in Unity3.0

Hi all,

In order to unzip a zip file from my unity script
I did the following :

  1. from DotNetZip (http://dotnetzip.codeplex.com) i got the Ionic.zip.dll and put it the assets folder.

  2. write the following code:

     var options:Ionic.Zip.ReadOptions = new Ionic.Zip.ReadOptions();
     options.Encoding = System.Text.Encoding.GetEncoding("utf-8");
     
     var  zip:Ionic.Zip.ZipFile = new Ionic.Zip.ZipFile.Read(fileName,options);
     
     
     zip.ExtractAll(Application.persistentDataPath + "/",Ionic.Zip.ExtractExistingFileAction.OverwriteSilently);
    
  3. Works when i run it from Unity.

  4. When build it & run it as test.exe I got an “IBM437 codepage not supported”

    ArgumentException: Encoding name ‘IBM437’ not supported

    Parameter name: name
    at System.Text.Encoding.GetEncoding (System.String name) [0x00000] in :0

    at Ionic.Zip.ZipFile…cctor () [0x00000] in :0
    Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Ionic.Zip.ZipFile
    at connectUnzip+$Start$1+$.MoveNext () [0x00000] in :0

Any idea whats is happening?
Do we have an alternative on how to unzip files ?
Is it possible to have a cross platform solution ?

Found a dirty solution on the forums:

copy all I8N*.dll from Unity installation C:\Program Files\Unity\Editor\Data\Mono\lib\mono\unity
to the Assets folder of your project.

The question is why all these workarounds for an uzip?
Does this solution applies for non windows platforms? (Ndroid, MacOS, etc)

it is because some dependency dll files are missing from unity’s build. Navigate to: C:Program Files (x86)/Unity/Editor/Data/Mono/lib/mono/unity and copy all of the I18N.dlls. This will fix any incompatability issues