diff --git a/pkg/filemanager/manager/archive.go b/pkg/filemanager/manager/archive.go index daded9cf..efb4ff4b 100644 --- a/pkg/filemanager/manager/archive.go +++ b/pkg/filemanager/manager/archive.go @@ -283,7 +283,7 @@ func getZipFileList(ctx context.Context, file io.ReaderAt, size int64, textEncod info := f.FileInfo() modTime := info.ModTime() fileList = append(fileList, ArchivedFile{ - Name: util.FormSlash(hdr.Name), + Name: util.FormSlash(strings.ToValidUTF8(hdr.Name, "�")), Size: info.Size(), UpdatedAt: &modTime, IsDirectory: info.IsDir(), @@ -303,7 +303,7 @@ func get7zFileList(ctx context.Context, file io.ReaderAt, size int64, extEncodin info := f.FileInfo() modTime := info.ModTime() fileList = append(fileList, ArchivedFile{ - Name: util.FormSlash(f.Name), + Name: util.FormSlash(strings.ToValidUTF8(f.Name, "�")), Size: info.Size(), UpdatedAt: &modTime, IsDirectory: info.IsDir(), diff --git a/pkg/filemanager/workflows/extract.go b/pkg/filemanager/workflows/extract.go index 9fd2dce4..3c379cdf 100644 --- a/pkg/filemanager/workflows/extract.go +++ b/pkg/filemanager/workflows/extract.go @@ -375,7 +375,7 @@ func (m *ExtractArchiveTask) masterExtractArchive(ctx context.Context, dep depen return nil } - rawPath := util.FormSlash(f.NameInArchive) + rawPath := util.FormSlash(strings.ToValidUTF8(f.NameInArchive, "�")) savePath := dst.JoinRaw(rawPath) // If file mask is not empty, check if the path is in the mask @@ -751,7 +751,7 @@ func (m *SlaveExtractArchiveTask) Do(ctx context.Context) (task.Status, error) { return nil } - rawPath := util.FormSlash(f.NameInArchive) + rawPath := util.FormSlash(strings.ToValidUTF8(f.NameInArchive, "�")) savePath := dst.JoinRaw(rawPath) // If file mask is not empty, check if the path is in the mask