問題 JavaScriptでbase64エンコード、デコードをするなら、window.btoa, window.atob がありますよね。 window.btoa('Hello!'); // → "SGVsbG8h" window.atob('SGVsbG8h'); // → "Hello!" 日本語入れたらエラーになるんですけど、だめなんですか。 window.btoa('あいうえお'); // → x // Error: String contains an invalid character 答え 殆どのブラウザでは、window.btoa のパラメータにユニコードの文字列を指定して呼び出すと、例外「範囲外 (Out Of Range)」が返ります。 https://developer.mozilla.org/ja/docs/Web/API/window.btoa#Unicode_S