I have a situation where I'm using the Plancake email parser to parse emails from various sources. One of my sources is giving me trouble with parsing the subject. The following warning is issued and the subject is returned as an empty string:
PHP Notice: iconv_mime_decode(): Detected an illegal character in input string in....
The subject in the email is:
=?utf-8?B?VW5pdGVkSGVhbHRoY2FyZSBHbG9iYWwgU3BlY2lhbCBSZXBvcnQg4oCTIEluZGljYXRpb25zIG9mIEluY3JlYXNlZCBUZXJyb3Jpc20gVGhyZWF0IGluIFNhdWRpIEFyYWJpYQ==?
The character set for the email in the HTML section is set to:
Content-Type: text/html; charset="utf-8"
The code that I get the warning on is:
$ret = utf8_encode(iconv_mime_decode($this->rawFields['subject']));
I have now reached the legal limit of fun in debugging this. Anyone have any ideas?