Created
September 19, 2017 22:43
-
-
Save Neoglyph/d70d9c26c0d0aadc94641975c963146a to your computer and use it in GitHub Desktop.
UTF8 Base64 encode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function b64EncodeUnicode(str) { | |
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) { | |
return String.fromCharCode('0x' + p1); | |
})); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment