I find it odd that this package only provides support for null-terminated strings with the Utf8 and Utf16 marker types.
It's quite common these days to not use zero terminated strings, but to use string views which are ptr + size. This is done for example in Rust (&str) and C++ (std::string_view). Advantages over null-terminated strings are constant time length and no buffer overflows if you lose the \0.
toNativeUtf8NonZeroTerminated() would need some kind of different API most likely one that returns a record: both the pointer and the length. (Names TBD.)
I find it odd that this package only provides support for null-terminated strings with the
Utf8
andUtf16
marker types.It's quite common these days to not use zero terminated strings, but to use string views which are ptr + size. This is done for example in Rust (
&str
) and C++ (std::string_view
). Advantages over null-terminated strings are constant time length and no buffer overflows if you lose the\0
.