Upload via GUI (7543 Dateien)
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
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 };
|
||||
Reference in New Issue
Block a user