将字符串数据编码为 Uint8Array(UTF-8 编码)。
Uint8Array
需要编码的字符串数据。
编码后的 Uint8Array。
const encoded = textEncode('你好');console.log(encoded); // Uint8Array [228, 189, 160, 229, 165, 189] Copy
const encoded = textEncode('你好');console.log(encoded); // Uint8Array [228, 189, 160, 229, 165, 189]
将字符串数据编码为
Uint8Array(UTF-8 编码)。