strings: preserve UTF-8 and boundary invariants

This commit is contained in:
2026-08-09 17:46:22 +09:00
parent 2d947c469e
commit 8e2e6ae162
7 changed files with 124 additions and 61 deletions

View File

@@ -19,5 +19,5 @@ import encoding.utf8;
let r: str = strings.frombytes(b);
assert(!(!streq(r, "hello")));
assert(!(r.ptr != s.ptr)); // borrowed, not copied
assert(!(r.cap != r.len));
};