none
.zip file containing files with double byte characters in the file name RRS feed

  • Question

  • I have a situation where we are generating Pdf reports on the fly on our webserver and packaging them with some other image files that we generate based on the original image the user uploaded. 

    We are using the sharp zip lib library to create a .zip file that contains the Pdf and the images.

    For a couple of years, everything has been going well. Now we are doing a lot of business in Japan. The filenames for the files we include in the zip file are all some derivative of the filename of the original image the customer uploads. The uploaded files from the Japanese contain a lot of double byte characters in the filename, so the files we are zipping contain double byte characters.

    On Windows machines that have a third party zip viewing program, everything works fine when they download the zip file and extract its contents.

    On Windows machines that do not have a third party zip viewing program, only the zip fils that have all English characters in the file name work properly. Zip files that contain files that have double byte characters in the file name can be viewed and the files extracted but the file names of the files that have the double byte characters are all wrong. They have very strange characters and hollow boxes, etc. Nothing at all like the original Japanese characters.

    We have requested that our Japanese customers install a third party zip tool so that they do not have this problem but they are insisting that is too much trouble and want us to solve this problem so they don't have to get a separate tool just to view the contents of the zip files.

    Does anybody else have any experience with this and can give us some advice on how to make these zip files work. I can possibly provide examples though our customer's content is confidential so I would have to mock something up. But basically, to me it seems that the built in Send To -> Compressed folder feature of Windows does not even work if the files being compressed contain double byte characters. 

    Wednesday, February 6, 2013 4:02 PM

Answers