JsonLexer._validUtf8At

private bool _validUtf8At(size_t i, out size_t len) pure nothrow @nogc @safe const

Validates the UTF-8 sequence starting at index i in _src.

Enforces the well-formed UTF-8 definition (Unicode TS #18 style table): no overlong forms, no UTF-16 surrogate halves (U+D800-U+DFFF), no code points above U+10FFFF, and no truncated or stray-continuation sequences.

Parameters

iIndex of the candidate lead byte.
lenOutput: byte length of the validated sequence.

Returns

true when a well-formed sequence starts at i; len then

holds its byte count.