取值: JSON.parse(decodeURIComponent(escape(window.atob( sessionStorage.getItem('currentFormAnswerData') )));
An ASCII string containing the Base64 representation ofstringToEncode. Exceptions InvalidCharacterError The string contained a character that did not fit in a single byte. See "Unicode strings" below for more detail. Example const encodedData = window.btoa('Hello, world'); // encode a string ...
An ASCII string containing the Base64 representation ofstringToEncode. Exceptions InvalidCharacterError The string contained a character that did not fit in a single byte. See "Unicode strings" below for more detail. Example const encodedData = window.btoa('Hello, world'); // encode a string ...
My basic proposal is to add an optional second argument to atob and btoa, which would take an options bag allowing the developer to describe the binary encoding to use if the string contains non-ASCII bytes, as in: btoa("🚀", { encoding: "utf-8" /* utf-8 or utf-16 for now */...