def iter_byte_indices_utf8(text):
    """
    Iterate over the codepoint offset of each byte (UTF-8 only).
    """
    octets = text.encode('utf-8')
    i = -1
    for c in octets:
        if not 128 <= c < 192:
            i += 1
        yield i
    yield i + 1
