diff --git a/server/filesystem/archive.go b/server/filesystem/archive.go index ee6f3d6..5031f3c 100644 --- a/server/filesystem/archive.go +++ b/server/filesystem/archive.go @@ -8,6 +8,7 @@ import ( "path/filepath" "strings" "sync" + "time" "emperror.dev/errors" "github.com/apex/log" @@ -183,6 +184,14 @@ func (a *Archive) addToArchive(p string, rp string, w *tar.Writer) error { // Get the tar FileInfoHeader in order to add the file to the archive. header, err := tar.FileInfoHeader(s, filepath.ToSlash(target)) + + // set to format gnu so 7-zip can read Chinese Filename + header.Format = tar.FormatGNU + + // temp workaround for golang write accesstime and changetime into gnu_header‘s prefix. + header.AccessTime = time.Time{} + header.ChangeTime = time.Time{} + if err != nil { return errors.WrapIff(err, "failed to get tar#FileInfoHeader for '%s'", rp) }