Using Javascript’s atob to decode base64 doesn’t properly decode utf-8 strings
The Unicode Problem Though JavaScript (ECMAScript) has matured, the fragility of Base64, ASCII, and Unicode encoding has caused a lot of headache (much of it is in this question’s history). Consider the following example: 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 … Read more