Decodes the code point at index: its value and its length in bytes. A malformed byte decodes as
U+FFFD, one byte at a time, so a scan always advances.
code, size := decode_at("é", 0);
assert(code == 0xE9 && size == 2);decode_at :: (text: string, index: int) -> (code: u32, size: int)
Parameters
- text: string
- index: int
Returns
- code: u32
- size: int