Returns how many bytes the UTF-8 representation would require for the given codepoint.
pub fn utf8CodepointSequenceLength(c: u21) !u3
pub fn utf8CodepointSequenceLength(c: u21) !u3 {
if (c < 0x80) return @as(u3, 1);
if (c < 0x800) return @as(u3, 2);
if (c < 0x10000) return @as(u3, 3);
if (c < 0x110000) return @as(u3, 4);
return error.CodepointTooLarge;
}