tryDecodeUTF8

private fndchar tryDecodeUTF8(scope const(char)[] s, size_t pos, out size_t bytesConsumed) @safe

Attempt to decode a UTF-8 code point from the string at position pos.

If the sequence is malformed, consumes all continuation bytes that are part of the invalid sequence and returns U+FFFD.

Parameters

sInput string.
posStarting position (must point to a non-ASCII byte).
bytesConsumedOutput: number of bytes consumed.

Returns

The decoded code point, or U+FFFD for malformed sequences.