tryDecodeUTF8
private fn
dchar tryDecodeUTF8(scope const(char)[] s, size_t pos, out size_t bytesConsumed) @safeAttempt 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
s | Input string. |
pos | Starting position (must point to a non-ASCII byte). |
bytesConsumed | Output: number of bytes consumed. |
Returns
The decoded code point, or U+FFFD for malformed sequences.