If ture, assume str is a valid UTF-8 string and don't generate any error-checking code. If validated is true, str must be a valid character, otherwise undefined behavior will occur. Also affects the return type.
Will decode the first code point from this string.
Index in str where the code point starts. Will be updated to point to the next code point.
If validated is true, the decoded character. Otherwise a struct with a 'decoded' member - the decoded character, and a 'string errorMessage' member that is null on success and otherwise stores the error message.
@nogc version of std.utf.decode() for char[].
The caller must handle ASCII (< 0x80) characters manually; this is asserted to force code using this function to be efficient.