-
Notifications
You must be signed in to change notification settings - Fork 173
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
Feature: handle tracef's %c
as unicode code point
#411
base: main
Are you sure you want to change the base?
Conversation
Previously converted such character to UTF-16 char code, so large unicode characters would have been truncated. Now it's possible to pass unicode characters.
We should probably match the same behavior as C's For me this program: printf("Hello %c\n", 12345678); Prints |
But why? It's not like we are trying to implement libc. With this PR we would able to pass rust's |
Btw if we truncate, should we truncate to 7 bits for ASCII, or truncate to 8 bits and allow some UTF-16 char codes? Aren't non-ASCII characters for |
Could we truncate to 8 bits? libc For printing unicode characters, isn't it possible to use |
Until and even then we truncate to 8 bits, we probably could handle non-ascii chars as unicode code points instead of UTF-16 char codes? |
Current https://github.com/aduros/wasm4/blob/main/runtimes/web/src/runtime.ts#L272 To manually
This brings some runtime (~7KiB on all code optimizations) into the binary. It could have been better (now only ~2KIB) if there was an ability flush the line by parts, requiring no allocations. |
Previously converted such character to UTF-16 char code, so large unicode characters would have been truncated. Now it's possible to pass unicode characters.