Skip to content

fix(bindgen): fix string flat lowering of multibyte utf-8 and multiunit utf-16 chars - #1838

Merged
vados-cosmonic merged 3 commits into
bytecodealliance:mainfrom
lann:fix-string-lowering
Aug 6, 2026
Merged

fix(bindgen): fix string flat lowering of multibyte utf-8 and multiunit utf-16 chars#1838
vados-cosmonic merged 3 commits into
bytecodealliance:mainfrom
lann:fix-string-lowering

Conversation

@lann

@lann lann commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

UTF-8 length was lowered as codepoints instead of bytes, breaking on multibyte chars.

UTF-16 length was lowered as codepoints instead of code units, breaking on multi-unit chars. Additionally, the UTF-16 lowering was redundantly re-encoding the string - possibly a refactoring mistake?

@lann lann changed the title fix(bindgen): fix multibyte utf-8 and utf-16 flat lowering of strings fix(bindgen): fix string flat lowering of multibyte utf-8 and multiunit utf-16 chars Aug 5, 2026

@vados-cosmonic vados-cosmonic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 🚀

Thanks for fixing this and updating the test!

@vados-cosmonic
vados-cosmonic added this pull request to the merge queue Aug 6, 2026
Merged via the queue into bytecodealliance:main with commit 2103f72 Aug 6, 2026
52 checks passed
@lann
lann deleted the fix-string-lowering branch August 6, 2026 13:41
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