Our thinking


Unzip multiple zip files with unicode filenames inside the archive

I had a bunch of zip files from a Google Takeout that I needed to extract on macOS and deal with the contents.

As it turns out, a LOT of the files in the archives had unicode characters in their filenames, but unzip on the macOS command line didn’t deal with them properly.

I needed a way to extract them and ideally with whatever is included in macOS, I didn’t want to mess around installing MacPorts or Homebrew and Xcode on this system just to extract some zips.

Fortunately ditto is able to extract files from zips, and it correctly deals with unicode in filenames. To batch extract these files, I was able to run the following commands:

for zipfile in ~/Downloads/Takeout\ Zip\ Files/*.zip; do

    ditto -V -x -k --sequesterRsrc --rsrc "$zipfile"

done

This extracted everything, and didn’t freak out when it encountered unicode characters.

Leave a Reply