Created
December 13, 2010 15:52
-
-
Save badsyntax/739130 to your computer and use it in GitHub Desktop.
converted HEX 'encoded' emails to plain HTML
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
| function convert(content){ | |
| // This seems pretty reliable now | |
| return content | |
| .replace(/=\s*\n/g, '') // remove line endings | |
| .replace(/=(([a-f0-9]){2})/ig, function(m, hex){ // HEX codes (format: =0A) | |
| var charCode = parseInt(hex, 16); // Convert HEX code to CharCode | |
| return String.fromCharCode( charCode ); // Get Char string from CharCode | |
| }); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment