From 5282d08b2ed93b2686ac2c4c2a1385e4737d8561 Mon Sep 17 00:00:00 2001 From: amrbashir Date: Tue, 22 Oct 2024 07:33:06 +0300 Subject: [PATCH] fix(fs): fix `writeFile` and `writeTextFile` converting UTF-8 characters in path into replacement character closes #1849 --- plugins/fs/guest-js/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/fs/guest-js/index.ts b/plugins/fs/guest-js/index.ts index 57e7518d..ed8749d7 100644 --- a/plugins/fs/guest-js/index.ts +++ b/plugins/fs/guest-js/index.ts @@ -1072,7 +1072,7 @@ async function writeTextFile( await invoke('plugin:fs|write_text_file', encoder.encode(data), { headers: { - path: path instanceof URL ? path.toString() : path, + path: encodeURIComponent(path instanceof URL ? path.toString() : path), options: JSON.stringify(options) } })