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:
SRutile
2024-09-11 23:02:24 +08:00
committed by GitHub
parent 3715f3c9a6
commit 9291e4d2ca
6 changed files with 13 additions and 5 deletions
+1
View File
@@ -31,6 +31,7 @@ glob = "0.3"
notify = { version = "6", optional = true, features = ["serde"] }
notify-debouncer-full = { version = "0.3", optional = true }
dunce = { workspace = true }
percent-encoding = "2"
[features]
watch = ["notify", "notify-debouncer-full"]