Skip to content

fix(share): replace btoa/atob with encodeURIComponent for Unicode support - #1803

Open
Tarulatapriya wants to merge 4 commits into
reframe-oss:mainfrom
Tarulatapriya:fix/btoa-unicode-crash
Open

Tarulatapriya wants to merge 4 commits into
reframe-oss:mainfrom
Tarulatapriya:fix/btoa-unicode-crash

Conversation

@Tarulatapriya

Copy link
Copy Markdown
Contributor

Fix Summary

Fixes an issue where sharing video recipes with text overlays containing Unicode characters (e.g., emojis 🎬 😊, non-Latin text) caused an unhandled DOMException / InvalidCharacterError in JavaScript's native btoa() method:

Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.

Changes Made

  • URL Recipe Encoding: Replaced btoa() / atob() with encodeURIComponent(JSON.stringify(recipe)) and decodeURIComponent(encoded) for settings query parameters.
  • Backward Compatibility: Added a decodeURIComponent(escape(atob(encoded))) fallback in decodeRecipe() to support decoding legacy base64-encoded share URLs seamlessly.
  • Unit Tests: Added automated unit tests in src/hooks/tests/useVideoEditor.test.ts to verify Unicode text overlay handling.
  • Validation: All 129 vitest unit tests across 14 test suites pass cleanly.

@netlify

netlify Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

👷 Deploy request for reframe-os pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 9a2088a

@github-actions github-actions Bot added level:advanced Advanced level - 55 pts type:bug Bug fix type:testing Testing labels Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @Tarulatapriya!

Welcome to Reframe — a browser-based video editor built for everyone 🎬

What happens next

  1. 🤖 Automated checks — build & TypeScript typecheck will run automatically
  2. ✅ Vercel preview — a preview deployment will be created (requires maintainer authorization for fork PRs)
  3. 👀 Code review — a maintainer will review your changes
  4. 🚀 Merge — once approved, your PR will be merged!

Quick checklist

  • PR title follows Conventional Commits (e.g. feat: add dark mode)
  • Linked the issue this PR closes (e.g. Closes #123)
  • Tested the changes locally (bun run dev)
  • Build passes (bun run build)

Useful links

Happy coding! 🎉

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

⚠️ PR Format Issues — @Tarulatapriya

Please fix the following before your PR can be reviewed:

  • ⚠️ No linked issue found. Add Closes #<issue-number> to your PR description.

Push new commits after fixing — this comment will update automatically.

📖 CONTRIBUTING.md

@github-actions github-actions Bot added the level:intermediate Intermediate level - 35 pts label Oct 17, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:advanced Advanced level - 55 pts level:intermediate Intermediate level - 35 pts type:bug Bug fix type:testing Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants