News for hackers. Stuff that matters.
Re:Libgrapheme: A simple freestanding C99 library for Unicode by kristoff_it on Wednesday November 16, 2022 @09:15AM (#33623263)
> Zig seems to be even worse than Go, requiring null-termination instead of storing them as Pascal strings. This means that a valid substring requires a copy so that the substring can itself be null-terminated to be valid. Inner pointers are not valid unless to the end of the parent and therefore substrings are very expensive relatively speaking.

No, Zig uses slices normally (ie ptr + len). Terminators are part of the type system for the (relatively rare, mostly related to C interop) cases where you really want a sentinel value at the end of your array.

Re:Libgrapheme: A simple freestanding C99 library for Unicode by arcticbull on Wednesday November 16, 2022 @09:29AM (#33623528)
I see, I misread the docs. However everything else I stand by, after all it allows you to embed invalid UTF-8 content.