Created
October 2, 2017 19:32
-
-
Save 5a494d/7b23748254e9ddada2b592b44f83ab72 to your computer and use it in GitHub Desktop.
Escape Characters
This file contains hidden or 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
var source = '\x53\x6f\x72\x72\x79\x21\x20You\x72 \x6be\x79\x20\x66\x69l\x65\x20\x69s i\x6eva\x6ci\x64\x2e'; | |
var decoded = source.replace(/\\x([a-f0-9][a-f0-9])/g, function(a,b) { | |
return String.fromCharCode(parseInt(b, 16)); | |
}); | |
document.write(decoded); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment