Skip to content

Commit

Permalink
fix(fs): fix writeFile converting UTF-8 characters in path into rep…
Browse files Browse the repository at this point in the history
…lacement character (tauri-apps#1965)
  • Loading branch information
amrbashir authored Oct 22, 2024
1 parent 525abc4 commit 77149dc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changes/fs-writeTextFile-utf8-path.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fs-js": "patch"
---

Fix `writeTextFile` converting UTF-8 characters (for example `äöü`) in the given path into replacement character (``)
2 changes: 1 addition & 1 deletion plugins/fs/api-iife.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/fs/guest-js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})
Expand Down

0 comments on commit 77149dc

Please sign in to comment.