CharacterIterator

struct CharacterIterator

Walks extended grapheme clusters across a borrowed UTF-8 range.

offset is always a cluster boundary no later than end. Malformed UTF-8 follows the decoder's maximal-subpart replacement rule, so iteration always makes progress without allocating.

Properties

let offset: Int

The byte offset in the underlying storage.

let end: Int

The exclusive ending byte offset in the source.