pub fn wtf8Decode(bytes: []const u8) Wtf8DecodeError!u21 bytes: []const u81649
1650
1651
1652
1653
1654
1655
1656
1657pub fn wtf8Decode(bytes: []const u8) Wtf8DecodeError!u21 {
return switch (bytes.len) {
1 => bytes[0],
2 => utf8Decode2(bytes[0..2].*),
3 => utf8Decode3AllowSurrogateHalf(bytes[0..3].*),
4 => utf8Decode4(bytes[0..4].*),
else => unreachable,
};
}
Deprecated. This function has an awkward API that is too easy to use incorrectly.