From: René Scharfe Date: Tue, 4 Sep 2012 20:23:38 +0000 (+0200) Subject: archive-zip: support UTF-8 paths X-Git-Tag: v1.8.0-rc0~12^2~3 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/2162bd8cc461d6c3a12ab81c5db5a44bf5ecabc3?hp=2162bd8cc461d6c3a12ab81c5db5a44bf5ecabc3 archive-zip: support UTF-8 paths Set general purpose flag 11 if we encounter a path that contains non-ASCII characters. We assume that all paths are given as UTF-8; no conversion is done. The flag seems to be ignored by unzip unless we also mark the archive entry as coming from a Unix system. This is done by setting the field creator_version ("version made by" in the standard[1]) to 0x03NN. The NN part represents the version of the standard supported by us, and this patch sets it to 3f (for version 6.3) for Unix paths. We keep creator_version set to 0 (FAT filesystem, standard version 0) in the non-special cases, as before. But when we declare a file to have a Unix path, then we have to set the file mode as well, or unzip will extract the files with the permission set 0000, i.e. inaccessible by all. [1] http://www.pkware.com/documents/casestudies/APPNOTE.TXT Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano ---