浏览代码

:bug: Unable to export Data if workspace folder contains non-ASCII characters Fix https://github.com/siyuan-note/siyuan/issues/8678

Daniel 2 年之前
父节点
当前提交
164c679d89
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      kernel/model/export.go

+ 6 - 0
kernel/model/export.go

@@ -255,6 +255,12 @@ func ExportDataInFolder(exportFolder string) (name string, err error) {
 		return
 	}
 	name = filepath.Base(zipPath)
+	name, err = url.PathUnescape(name)
+	if nil != err {
+		logging.LogErrorf("url unescape [%s] failed: %s", name, err)
+		return
+	}
+
 	targetZipPath := filepath.Join(exportFolder, name)
 	zipAbsPath := filepath.Join(util.TempDir, "export", name)
 	err = filelock.Copy(zipAbsPath, targetZipPath)