Skip to content

Commit 4fd7205

Browse files
committed
docs: Clarify textUtf* misnomers (solves #509)
1 parent 47da736 commit 4fd7205

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

site/docs/reference/functions.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ By default, `str` is expected to be a `\0` terminated ASCII string.
9191
This means bytes `0x80-0xFF` are treated as individual characters, even in programming languages where strings are normally UTF-8 encoded.
9292
No terminating `\0` is needed in those languages.
9393
In languages where all strings are UTF-16, `str` must only contain characters up to U+00FF and no `\0` is needed.
94+
95+
The text drawing functions in WASM-4's internals and bindings are called `textUtf8` and `textUtf16` for UTF-8 and UTF-16 respectively,
96+
but these names are misnomers and don't actually use UTF-8 or UTF-16 encodings.
97+
If you encounter these functions, instead treat them according to the explanation above.
9498
:::
9599

96100
## Sound

0 commit comments

Comments
 (0)