I want to convert the following raw mail subject to normal UTF-8 text:
=?UTF-8?B?UmU6ICMyLUZpbmFsIEFjY2VwdGFuY2UgdGVzdCB3aXRoIG5ldyB0ZXh0IHdpdGggU2xvdg==?= =?UTF-8?B?YWsgaW50ZXJwdW5jdGlvbnMgIivEvsWhxI3FpcW+w73DocOtw6khxYgi?=
The real text for that is (yes, there are some crazy diacritics in it):
Re: #2-Final Acceptance test with new text with Slovak interpunctions "+ľščťžýáíé!ň"
The way I handle mail subjects:
function subject_imapUtf8($str){
$conv = '';
$subParts = preg_split('/[\r\n]+/',$str);
for($i=0;$i<count($subParts);$i++){
$conv .= imap_utf8(trim($subParts[$i]));
}
return $conv;
}
For the example this gives me:
=?UTF-8?B?UmU6ICMyLUZpbmFsIEFjY2VwdGFuY2UgdGVzdCB3aXRoIG5ldyB0ZXh0IHdpdGggU2xvdg==?=ak interpunctions "+ľščťžýáíé!ň"
So as you can see the second part/line of the subject is converted correclty.
What do I need to change to convert the first part correctly?