electric pulp interactive agency

our blog. keeping it real. real awesome that is.

Archive for the ‘Tips and Tricks’ Category

Decode quoted-printable text with this handy dandy TextMate command(y)

Thursday, December 20th, 2007

Next time you find yourself staring at an ugly block of HTML-ish text, copied from the source of an email message, full of strange “=3D” and trailing “=” characters, take heart. The nastiness you’re seeing is called quoted-printable format, and it’s how email keeps lines to a short enough length to be widely compatible with all manner of email servers.

Installation
Download this file, double-click it, and TextMate should do the rest. You’ll now have a command in your Text bundle that you can use to undo the quoted-printable encoding.

It changes this:

<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D”text/html; charset=3Dutf-8″>
<META content=3D”MSHTML 6.00.2900.3199″ name=3DGENERATOR></HEAD>
<BODY style=3D”MARGIN: 4px 4px 1px; FONT: 10pt Tahoma”>
<DIV>Good afternoon,</DIV>
<DIV><BR>Please see the following information from Company.  Please =
let me know if you have any questions or concerns.<BR><BR>Thanks,<BR>Bobby=
<BR>12/18/07 10:18 AM >>><BR></DIV></BODY></HTML>

To this:

<HTML><HEAD>
<META http-equiv=Content-Type content=”text/html; charset=utf-8″>
<META content=”MSHTML 6.00.2900.3199″ name=GENERATOR></HEAD>
<BODY style=”MARGIN: 4px 4px 1px; FONT: 10pt Tahoma”>
<DIV>Good afternoon,</DIV>
<DIV><BR>Please see the following information from Company.  Please let me know if you have any questions or concerns.<BR><BR>Thanks,<BR>Bobby<BR>12/18/07 10:18 AM >>><BR></DIV></BODY></HTML>

Caveat - this command only removes the quoted-printable formatting, don’t expect it to work any magic to make the actual HTML standards compliant.

Enjoy!

Download the quoted-printable decoder TextMate command