Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Functions utf8DecodeNext

1
2
3
4
5
6
7
8
9
module juptune.data.utf8;

Result utf8DecodeNext(
    alias AlgorithmT = Utf8DefaultAlgorithm
)(
    const void[] input, 
    size_t cursor, 
    dchar decoded
);

Documentation

Validates and decodes the next UTF-8 codepoint from the given input.

Notes

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.

Params

Throws

Utf8Error.invalid, Utf8Error.tooShort, Utf8Error.tooLong, Utf8Error.overlong, Utf8Error.tooLarge, Utf8Error.surrogate, and Utf8Error.eof. Please see their documentation on what conditions trigger them.

Returns

A non-errorful Resultif inputis a valid UTF-8 string, otherwise a Resultroughly specifying why inputis invalid.