Function wtf8Encode [src]

Encodes the given codepoint into a WTF-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 WTF-8. Returns: the number of bytes written to out.

Prototype

pub fn wtf8Encode(c: u21, out: []u8) error{CodepointTooLarge}!u3

Parameters

c: u21out: []u8

Possible Errors

CodepointTooLarge

Source

pub fn wtf8Encode(c: u21, out: []u8) error{CodepointTooLarge}!u3 { return utf8EncodeImpl(c, out, .can_encode_surrogate_half); }