Feature: handle tracef's %c as unicode code point#411
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.