It seems that imap_savebody saves attachments with special characters above ascii 127 as quoted printable. But if you need it in utf8, you may use the imap_qprint function after the attachment is saved: