Skip to content

Instantly share code, notes, and snippets.

@spite
Created June 25, 2015 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save spite/952643a464583adc25b1 to your computer and use it in GitHub Desktop.
Save spite/952643a464583adc25b1 to your computer and use it in GitHub Desktop.
Base64 encode/decode UTF-8
function b64EncodeUnicode(str) {
return btoa( unescape( encodeURIComponent( str ) ) );
}
function b64DecodeUnicode(str) {
return decodeURIComponent( escape( atob( str ) ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment