I had some problems with the german umlauts from a gmail fetched text. I lost an hour trying to find a solution.
Hopefully this helps someone in need :)
<?php
$text = trim( utf8_encode( quoted_printable_decode(
imap_fetchbody( $this->inbox, $emailNo, $section ) ) ) );
$section was previously defined:
$section = empty( $attachments ) ? 1 : 1.1;
?>