Skip to main content

is_utf8_char_boundary

No overview available.

def is_utf8_char_boundary(
data: bytes,
index: integer
) - > boolean

Determines if a specific byte index in a byte sequence represents the start of a UTF-8 encoded character.

Parameters

NameTypeDescription
databytesThe raw byte sequence to be checked for character boundaries.
indexintegerThe zero-based position within the byte sequence to validate as a boundary.

Returns

TypeDescription
booleanTrue if the byte at the given index is the first byte of a character or the end of the sequence; False if it is a continuation byte.