Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29745

Converting subject in email header to utf-8

$
0
0

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?


Viewing all articles
Browse latest Browse all 29745

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>