ソースを参照

: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
 		return
 	}
 	}
 	name = filepath.Base(zipPath)
 	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)
 	targetZipPath := filepath.Join(exportFolder, name)
 	zipAbsPath := filepath.Join(util.TempDir, "export", name)
 	zipAbsPath := filepath.Join(util.TempDir, "export", name)
 	err = filelock.Copy(zipAbsPath, targetZipPath)
 	err = filelock.Copy(zipAbsPath, targetZipPath)