dart-lang / dart-lang/native

Add `Utf8`/`Utf16` methods for non-zero terminated strings

Open
#933 1 comment 0 reactions 0 assignees View on GitHub
package:ffi
Dominant language
Dart
Stars
275
Forks
144
Avg merge
2d 10h
Merged PRs (30d)
47

Description

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`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.