fn utf8Encode(c: u21, out: []u8) !u3

Encodes the given codepoint into a UTF-8 byte sequence. c: the codepoint. out: the out buffer to write to. Must have a len >= utf8CodepointSequenceLength(c). Errors: if c cannot be encoded in UTF-8. Returns: the number of bytes written to out.

Parameters

c: u21,
out: []u8,