I'm having problems receiving utf8 reading emails via php (5.3) when they include special characters such as the euro sign.
I'm aware I should be using a test on $structure->encoding=3 for UTF8 (as seen in PHP IMAP decoding messages), etc, but to boil this specific problem down to its raw state I've created the following simple testbed using the email header taken from an email sent from Outlook to myself - and using this encoded message - I've tried to parse it via PHP onto a simple HTML output - but instead of seeing my special characters as they were, I see question marks (?) instead.
Testbed:
<?php
echo "<HTML><BODY>";
$v1=" =?utf-8?B?Rlc6IFRlc3QgQ2hhcmFjdGVycyBpbiB0aGUgU3ViamVjdCA6IMOY4oKswqU=?= =?utf-8?B?x5nDpg==?=";
echo "A=".utf8_decode(imap_utf8($v1));
echo "</BODY></HTML>";
?>
Output:
A= FW: Test Characters in the Subject : Ø?¥U??æ
BUT I was expecting
A=FW: Test Characters in the Subject : Ø€¥Ǚæ
.
What am I doing wrong?
Thanks
A