Module std/encoding/utf8.vv
The encoding/utf8 module provides UTF-8 encoding and decoding utilities.
Example:
import utf8 from "std/encoding/utf8.vv"
let bytes = utf8.encode('A')
let res = try utf8.decode(bytes)
console.print(res.char) // 'A'
Exports
fun encode(c)
extern "native"
Encodes a character to a list of UTF-8 bytes.
fun decode(bytes)
extern "native"
Decodes a list of bytes to a character.
bytes: A list of integers representing UTF-8 bytes.
Returns a result containing a record { char = c, size = n } or an error.