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 utf8Length

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

Result utf8Length(
    alias AlgorithmT = Utf8DefaultAlgorithm
)(
    const void[] input, 
    size_t length
);

Documentation

Helper function to easily count the amount of codepoints within the given UTF-8 input.

Notes

This function uses utf8DecodeNextunder the hood, so validation is also performed.

Params

Throws

Anything that utf8DecodeNextthrows.

Returns

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