JSFiddle - React, Tailwind, and code Playground

by der_robert

JavaScript

function b64EncodeUnicode(str) {
    return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,
        function toSolidBytes(match, p1) {
            return String.fromCharCode('0x' + p1);
    }));
}

console.log(b64EncodeUnicode('öäüÖÄÜ?ß=)(/&%$§"!){[]}`#'));

// var_dump(base64_decode("w7bDpMO8w5bDhMOcP8OfPSkoLyYlJMKnIiEpe1tdfWAj"));