0

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

Community
  • 1
  • 1
user1432181
  • 918
  • 1
  • 9
  • 24
  • Does your HTML page have the proper encoding? (utf-8)? – Max Mar 10 '16 at 20:11
  • Don't think page encoding would matter here - but do you have a suggestion on what meta tag I could add to rule it out; note, I've taken the same results through to a database - and the database is showing the same problems – user1432181 Mar 11 '16 at 09:36

0 Answers0