123456789module juptune.data.utf8;
Result utf8DecodeNext(
alias AlgorithmT = Utf8DefaultAlgorithm
)(
const void[] input,
size_t cursor,
dchar decoded
);
Validates and decodes the next UTF-8 codepoint from the given input.
After calling this function on success, the cursorwill be advanced to the position of the next codepoint to decode.
The value of decodedand cursoris undefined if an error is thrown.
Utf8Error.invalid, Utf8Error.tooShort, Utf8Error.tooLong, Utf8Error.overlong, Utf8Error.tooLarge, Utf8Error.surrogate, and Utf8Error.eof. Please see their documentation on what conditions trigger them.
A non-errorful Resultif inputis a valid UTF-8 string, otherwise a Resultroughly specifying why inputis invalid.