2

I got a zip archive containing files some of which with a name containing German umlaute, such as ö. The unzip command on a terminal fails to create such files, complaining about an illegal byte sequence.

How can I fix that issue?

2

2 Answers 2

1

I ran the following command:

touch ö && zip -R ö.zip ö && rm ö && unzip ö.zip

It doesn't complain here. You have to specify your problem a bit further, or to upload the archive somewhere.

Did some googling, the problem is related to Zip's encoding. Two possible solutions:

  1. Use open, as in open fileWithUnicodeCharacters.zip. It looks like open will call an internal OS X program that has no problem open these type of .zip files.

  2. Replacing unzip utility used in our script with ditto

1

When zip fails with:

Archive:  archive.zip
error:  cannot create filename?.txt
    Illegal byte sequence

either use:

  • the Archive Utility app:

    open <path to zip file>
    
  • or the ditto command, which has proven to be more resilient than zip when uncompressing files with Unicode characters in their names:

    1. Launch Terminal.

    2. Run:

      ditto -V -x -k <path to zip file> <destination folder>

      where:

      <path to zip file> is the full or relative path to your zip file

      <destination folder> is the folder that will contain the uncompressed files

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .