imap_fetchbody and character encoding

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


I use imap_fetchbody to retrieve a message from the server, and I end up
with something which contains lots of characters like this...

I have tried  quoted_printable_decode(), which eliminates most of the
problems, however sometimes a message comes in in which pound sterling
signs are converted into characters unreadable by firefox, and
represented by a question mark.

Removing quoted_printable_decode() renders that character as "=A3".

Not all emails are affected, and some are fine.

Does anyone know of how to detect messages which are likely to cause
this problem, and convert those messages into a character encoding that
is correct?

I have tried mb_convert_encoding, with no luck.

Site Timeline