Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(fs): fix writeTextFile converting UTF-8 characters in path into replacement character #1965

Merged
merged 3 commits into from
Oct 22, 2024

Conversation

amrbashir
Copy link
Member

closes #1849

@amrbashir amrbashir requested a review from a team as a code owner October 22, 2024 03:12
Copy link
Contributor

github-actions bot commented Oct 22, 2024

Package Changes Through a6fc2d3

There are 1 changes which include fs-js with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
api-example-js 2.0.1 2.0.2
fs-js 2.0.1 2.0.2

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@Legend-Master
Copy link
Contributor

Legend-Master commented Oct 22, 2024

I can't reproduce this problem with the current head on Windows 10 I can now, not sure what happened

image

Couldn't we just use encodeURI here?

@amrbashir
Copy link
Member Author

we were using encodeURIcomponent which is similar and didn't work

@Legend-Master
Copy link
Contributor

Legend-Master commented Oct 22, 2024

Both encodeURIcomponent and encodeURI worked for me here

image

- path: path instanceof URL ? path.toString() : path,
+ path: encodeURIComponent(path instanceof URL ? path.toString() : path),

Also I can't reproduce this bug with writeFile

…ers in path into replacement character

closes #1849
@amrbashir
Copy link
Member Author

looks like I was testing writeTextFile but was looking at the code of writeFile, oh well all that time is wasted I guess

@Legend-Master Legend-Master changed the title fix(fs): fix writeFile and writeTextFile converting UTF-8 characters in path into replacement character fix(fs): fix writeFile converting UTF-8 characters in path into replacement character Oct 22, 2024
@amrbashir amrbashir merged commit 77149dc into v2 Oct 22, 2024
10 checks passed
@amrbashir amrbashir deleted the fix/fs/utf8-path branch October 22, 2024 05:17
@Legend-Master Legend-Master changed the title fix(fs): fix writeFile converting UTF-8 characters in path into replacement character fix(fs): fix writeTextFile converting UTF-8 characters in path into replacement character Oct 22, 2024
Sir-Thom pushed a commit to Sir-Thom/plugins-workspace that referenced this pull request Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tauri V2: writeFile can not handle UTF-8 characters in the filename
2 participants