📜  js 解码 base64 utf8 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:26.835000             🧑  作者: Mango

代码示例1
const ok = "a";
console.log(ok.codePointAt(0).toString(16)); //   61: occupies < 1 byte

const notOK = "✓"
console.log(notOK.codePointAt(0).toString(16)); // 2713: occupies > 1 byte

console.log(btoa(ok));    // YQ==
console.log(btoa(notOK)); // error