title: Reliably Clean Email Message Body Encoding
body: <p>I am writing a small piece of software in php which connects to a IMAP email box and stores the messages contained therein in a MySQL DB for later processing and other goodness.</p>
  
  <p>I have noticed that during testing I get some strange characters appearing in the message body when I attempt to save the message body raw. I am using imap_fetchbody() to extract the message body.</p>
  
  <p>I noticed that when I use quoted_printable_decode() to clean up the message body this helps! However in doing lots of research I have also learned that this will not always help and that other methods such as utf8_encode() and base64_decode() should be used instead to clean up the message body. </p>
  
  <p>So, my question is: what is the best method for reliably cleaning an email message body with php to cover all encoding scenarios?</p>