///|
test "encode" {
let bytes = @ascii.encode("hello")
inspect(bytes, content="b\"hello\"")
}///|
test "decode" {
let bytes : Bytes = b"\x68\x65\x6C\x6C\x6F"
let s = @ascii.decode(bytes)
inspect(s, content="hello")
}///|
test "decode_lossy" {
let bytes : Bytes = b"\x68\x80\x6F"
let s = @ascii.decode_lossy(bytes)
inspect(s, content="h\u{FFFD}o")
}fn decode_lossy(bytes : BytesView) -> Stringfn encode(str : StringView) -> BytesInstall
Installed by default