0

I am downloading the result of a configurator in .zip. And what my surprise, since it has changed the name of all the files with accents to "weird" characters. Zip = True when defining the Activity.

Is there a way to tell it to compress in UTF-8 so that it respects all characters? Since we have no control over how it compresses it. If we did it with 7Zip, we can use the "cu" parameter, but in the Activity we only put "Zip = True" so that it compresses the result folder.

Thanks.

Error accents in zip result

  • Please do not link results. A good question should be self-contained (also because links will disappear, and this is a reference site). The problem is not about compression, about the encoding. Probably (but I will not open your link) your editor will not read the file as UTF-8. In this case just tell the editor that the file is UTF-8 – Giacomo Catenazzi Mar 10 '21 at 13:18
  • That is, should we indicate in the download that the .zip file is in UTF-8 format? Could we have an example? Thanks. – Jose Alberto Torres Jaraute Mar 10 '21 at 14:36
  • No. Zip will just extract the data (without changing the meaning). The problem is on how you interpret the data, and there is no way to be sure how to interpret such data (but if you specify the encoding "off-band"). Web, Linux, macos, etc. now use utf-8 as standard/default. Windows is (as usually) slow and so it creates a lot of problems. You may add a BOM to the file, but than it is not fully compatible with other systems). Some editors are smarter then other and will see UTF-8. – Giacomo Catenazzi Mar 10 '21 at 15:04
  • I have tried decompressing it with "7z" using the "-sccUTF-8" and "scsUTF-8" switches with the same result. Accented names come out with the rare symbol instead of the accented vowel. I have tried all encoding switches with the same result. This tells me that what is inside .zip in an encoding can no longer be changed, if it has not been generated before. – Jose Alberto Torres Jaraute Mar 10 '21 at 15:13
  • Forget 7z. They are lossless algorithms. If the file inside is utf-8, with just the default you get back the original file. You are looking at the wrong part. Look your text file, and check which encoding they are. Open an editor and check the encoding, until you find the encoding which give you the correct visualization. So now you know the encoding of the file. Forget 7z (but if you did a very stupid thing on compressing the files). – Giacomo Catenazzi Mar 10 '21 at 15:17
  • @JoseAlbertoTorresJaraute You may remove the tags `utf-8` and `zip` as your question is `autodesk-designautomation` specific. – Rahul Bhobe Mar 10 '21 at 16:53

2 Answers2

1

It may be also issue of unarchiving on the worker. We have document of how to deal with it. From our documentation:

Non-English filenames in ZIP files By default, most ZIP archivers do not use UTF-8 encoding to store filenames, and ZIP archives created from them do not store a code page for filenames. As a result, Design Automation needs a hint to extract filenames from the archive correctly. Use one of the following workarounds if filenames in your ZIP archive are not in the ASCII code page:

Force UTF-8 usage in your archiver. For example: 7-Zip accepts the “cu” parameter to use UTF-8 for filenames.

Add a hint file to the ZIP. A hint file is an empty “XYZ.codepage” file, where “XYZ” is either a code page name or a code page number. For example: for Cyrillic it can be “CP866.codepage” or “866.codepage”.

Copy/pasted from https://forge.autodesk.com/en/docs/design-automation/v3/developers_guide/troubleshooting/

0

Best option you have is to use Zip = False, and specify the location of the file in localName=results.zip. Then you can prepare the zip file results.zip in your AppBundle code in the format of your choice.

Activity parameter:

    "results": {
        "zip": false,
        "ondemand": false,
        "verb": "put",
        "description": "Zip file",
        "required": true,
        "localName": "results.zip"
    }
Rahul Bhobe
  • 4,165
  • 4
  • 17
  • 32