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

Proper dataurl charset handling #275

Merged
merged 2 commits into from
Jun 28, 2024
Merged

Proper dataurl charset handling #275

merged 2 commits into from
Jun 28, 2024

Conversation

CodeSmith32
Copy link
Contributor

  • fix for handling data urls with charsets, e.g., data:text/html;charset=utf-8;base64,...
  • properly decode unicode charsets

Currently, when viewing data urls with charsets, the app crashes because the header isn't stripped and base64 decoding (window.atob) throws an error due to invalid base64 chars. This uses a regex for stripping the header with any charset, but also extracts the charset and uses TextDecoder to convert the binary string into a unicode string before being written to the iframe (if necessary).

- fix for handling data urls with charsets, e.g., data:text/html;charset=utf-8;base64,...
- properly decode unicode charsets
@CodeSmith32
Copy link
Contributor Author

Hey @cyntler,

Anything I can/should do to help this get merged? Or any reason you think it shouldn't be merged?

@cyntler cyntler merged commit 85d4dad into cyntler:main Jun 28, 2024
1 check passed
@cyntler
Copy link
Owner

cyntler commented Jun 28, 2024

@CodeSmith32 I merged it.

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