Yggdrasil icon indicating copy to clipboard operation
Yggdrasil copied to clipboard

[unzip] Issues on MacOS and Windows

Open nhz2 opened this issue 2 years ago • 0 comments

unzip_jll fails to unzip certain types of zip files on MacOS and Windows. These files can be unzipped by the builtin unzip command and can also be unzipped by unzip_jll on Ubuntu.

I'm testing unzip_jll in https://github.com/JuliaIO/ZipArchives.jl/pull/36

On Windows there seems to be some issue with UTF-8.

using ZipArchives
using unzip_jll
dir = mktempdir()
cd(dir)
ZipWriter("utf8.zip") do w
    zip_writefile(w, "🐨.txt", b"test")
end
run(`$(unzip()) utf8.zip -d out`)

On Windows this fails with the following error:

Archive:  utf8.zip
dY?".txt:  mismatching "local" filename (_.txt),
         continuing with "central" filename version
 extracting: out/dY?".txt  

and creates a file named "ðŸ\u90¨.txt"

On MacOS there seems to be some issue with zip64 support.

using ZipArchives
using unzip_jll
dir = mktempdir()
cd(dir)
open("files64.zip"; write=true) do io
    ZipWriter(io; force_zip64=true) do w
        zip_writefile(w, "test1.txt", b"test")
    end
end
run(`$(unzip()) files64.zip -d out`)

On MacOS this gives the error:

Archive:  files64.zip
   skipping: test1.txt               need PK compat. v4.5 (can do v2.1)

and doesn't create any files.

nhz2 avatar Nov 15 '23 01:11 nhz2