📅  最后修改于: 2022-03-11 15:02:18.036000             🧑  作者: Mango
if (!("TextEncoder" in window))
alert("Sorry, this browser does not support TextEncoder...");
var enc = new TextEncoder(); // always utf-8
console.log(enc.encode("This is a string converted to a Uint8Array"));