llvm::findMaximalSubpartOfIllFormedUTF8Sequence

Returns the length of the maximal subpart of an ill-formed UTF-8 sequence.

Synopsis

Declared in <llvm/Support/ConvertUTF.h>

unsigned int
findMaximalSubpartOfIllFormedUTF8Sequence(
    UTF8 const* source,
    UTF8 const* sourceEnd);

Description

Implements Unicode 6.3.0 D93b: the longest initial subsequence that is either a prefix of a well-formed sequence, or a single code unit. The input must not be a legal UTF-8 sequence.

Return Value

the length in bytes of the maximal subpart.

Parameters

NameDescription
sourcePointer to the start of the ill-formed UTF-8 subsequence.
sourceEndPointer just past the end of the available buffer.