Skip to content

Instantly share code, notes, and snippets.

@badsyntax
Created December 13, 2010 15:52
Show Gist options
  • Select an option

  • Save badsyntax/739130 to your computer and use it in GitHub Desktop.

Select an option

Save badsyntax/739130 to your computer and use it in GitHub Desktop.
converted HEX 'encoded' emails to plain HTML
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