Skip to content

fix(cli/migrate): tolerate non-UTF-8 in migration#9457

Merged
amrbashir merged 8 commits intotauri-apps:devfrom
kornelski:dev
Apr 15, 2024
Merged

fix(cli/migrate): tolerate non-UTF-8 in migration#9457
amrbashir merged 8 commits intotauri-apps:devfrom
kornelski:dev

Conversation

@kornelski
Copy link
Contributor

When I ran cargo tauri migrate I got only:

Error Stream did not contain valid UTF-8

which is a completely unhelpful dead-end.

  • I've made stdout/stderr captures tolerate non-UTF-8 text.
  • I've added context to migrator's errors that help locate the root cause.
  • I've made migrator skip and warn about non-UTF-8 JavaScript files instead of aborting the entire operation.

@kornelski kornelski requested a review from a team as a code owner April 13, 2024 18:17
@amrbashir
Copy link
Member

Instead of skipping non-utf8 files, I changed it to replace bytes instead, tested by appending invalid utf8 bytes to a JS file echo -n -e '\x00\x9F\x92\x96' >> src/App.jsx, let me know if I missed anything

@amrbashir amrbashir changed the title Tolerate non-UTF-8 in migration fix(cli/migrate): tolerate non-UTF-8 in migration Apr 15, 2024
@amrbashir amrbashir merged commit 73c1c2d into tauri-apps:dev Apr 15, 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.

2 participants