mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-30 17:48:50 +02:00
fix(fs): support any UTF-8 path in writeFile (#1640)
* In the `writeFile` function, when `options.baseDir` is not set, convert `path` to URL to avoid errors caused by Chinese characters. * fmt * use TextEncoder * use percent encoding * add change file * fmt --------- Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
co-authored by
Lucas Nogueira
parent
3715f3c9a6
commit
9291e4d2ca
@@ -1015,7 +1015,7 @@ async function writeFile(
|
||||
|
||||
await invoke('plugin:fs|write_file', data, {
|
||||
headers: {
|
||||
path: path instanceof URL ? path.toString() : path,
|
||||
path: encodeURIComponent(path instanceof URL ? path.toString() : path),
|
||||
options: JSON.stringify(options)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user