File size: 281 Bytes
391a73c
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
import { toUint8Array } from "../bytes/index.js";
export function encode(text) {
    return new TextEncoder().encode(text);
}
export function decode(data) {
    return new TextDecoder("utf-8", { fatal: false }).decode(toUint8Array(data));
}
export const utf8 = { encode, decode };