Created
September 19, 2017 22:09
-
-
Save Neoglyph/772f2630bbb21ae446b02659d5b82a49 to your computer and use it in GitHub Desktop.
UTF-8 base64 decode
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
// base64 decode and utf-8 decode the base64 encoded string | |
let encodedData = 'base64encodedstring...'; | |
let decodedData = JSON.parse(decodeURIComponent(Array.prototype.map.call(atob(encodedData), function(c) { | |
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); | |
}).join(''))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment