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 JS UTF16 #371

Merged
merged 2 commits into from
Nov 23, 2023
Merged

Fix JS UTF16 #371

merged 2 commits into from
Nov 23, 2023

Conversation

robertbastian
Copy link
Collaborator

No description provided.

@robertbastian robertbastian requested a review from sffc November 23, 2023 00:43
@@ -5,7 +5,7 @@ export function readString8(wasm, ptr, len) {

export function readString16(wasm, ptr, len) {
const buf = new Uint16Array(wasm.memory.buffer, ptr, len);
return String.fromCharCode(buf)
return String.fromCharCode.apply(null, buf)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh, I noticed this earlier and figured this was just some functionality of .fromCharCode I didn't know, JS has a lot of these helpers. Should have left a comment.

Anyway, this works

@robertbastian robertbastian merged commit d994837 into rust-diplomat:main Nov 23, 2023
5 checks passed
@robertbastian robertbastian deleted the js branch November 23, 2023 15:49
Copy link
Contributor

@sffc sffc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Would like to make sure this is tested somewhere because it clearly isn't being tested, at least not in this repo. :)

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.

3 participants