FortuneN / cordova-plugin-zeep

Zip compression/decompression for the cordova/phonegap platform
Apache License 2.0
28 stars 37 forks source link

unzipped file is different from original #5

Open jhjulkun opened 7 years ago

jhjulkun commented 7 years ago

Thanks for creating the plugin!

However, it seems its not correct when unzipping binary files.

I tried creating a random file, and when comparing the original file with the unzipped version the files are different!

Since I could not find any examples online this is how the test file was created:

dd if=/dev/urandom bs=100k count=1 of=random.raw; zip test.zip random.raw

I can also provide the test files I used if that's easier for you.

Thanks!

FortuneN commented 7 years ago

Please do provide test files & Let me know which platform (iOS, android or windows)

jhjulkun commented 7 years ago

Fails on windows. Did not try on iOS or Android since I'm using the existing zip plugin for those (so far)

Thanks for the plugin, would be great with one unified zip plugin!

test.zip

jhjulkun commented 7 years ago

Any ideas ? I found out that there is a encoding parameter that could explain the issue, but even after trying something it didn't unzip correctly (I'm not a c# guy so I most likely did something wrong). But suspect since data isn't UTF-8 encoded (most likely its 8859-1, not sure since its binary data).

entryNameEncoding Type: System.Text.Encoding The encoding to use when reading or writing entry names in this archive. Specify a value for this parameter only when an encoding is required for interoperability with zip archive tools and libraries that do not support UTF-8 encoding for entry names. https://msdn.microsoft.com/en-us/library/hh875102(v=vs.110).aspx