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

Unpaired surrogates in strings are not handled correctly #250

Open
chris-morgan opened this issue Sep 18, 2021 · 3 comments
Open

Unpaired surrogates in strings are not handled correctly #250

chris-morgan opened this issue Sep 18, 2021 · 3 comments
Labels
C-bug Category: bug, something isn't working S-unactionable Unactionable

Comments

@chris-morgan
Copy link

This can lead to astral plane characters like emoji and characters in some other languages getting turned into ��. Details at Pauan/rust-dominator#10 and the related issues that got created at around that time.

A simple way of synthesising this on the hello example without needing specific Windows software:

const input = document.querySelector('input');
input.value = 'hello\ud83d';
input.dispatchEvent(new CustomEvent('input'));

The input’s value should be hello\ud83d, but instead ends up hello\ufffd, which is wrong.

@lukechu10 lukechu10 added the C-bug Category: bug, something isn't working label Sep 18, 2021
@lukechu10
Copy link
Collaborator

rustwasm/wasm-bindgen#1348 has been closed so I think this should now be closed as well.

@chris-morgan
Copy link
Author

It was closed because it had gone as far as it could, adding new methods to check whether conversion would be lossless, and documenting things; but the conclusion there is pretty much “it’s up to users to use it correctly”. And that’s what Sycamore is not doing. Run the sample code against the TodoMVC example (since the hello example is gone) and you’ll see it’s still broken. This should be reopened.

@lukechu10
Copy link
Collaborator

Ah OK. I only took a quick look at the closed issues. I will reopen this now.

@lukechu10 lukechu10 reopened this Dec 10, 2022
@lukechu10 lukechu10 added the S-unactionable Unactionable label Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug, something isn't working S-unactionable Unactionable
Projects
None yet
Development

No branches or pull requests

2 participants