views:

183

answers:

2

I'm creating a small, web based, mail client in PHP and noticed that a number of email Subjects and Contents appear as follows:

=?ISO-8859-1?Q?Everything_for_=A35_-_Box_Sets,_Games_?= =?ISO-8859-1?Q?and_CD_Soundtracks...hurry,_ends_soon?=
=?utf-8?B?UGxheS5jb206IE9uZSBEYXkgT25seSDigJMgT3V0IG9mIHRoaXMgV29ybGQgRGVhbHMh?=
=?windows-1252?Q?Jon,_delivery_on_us_&_earn_=A35_credit_or_50_prints?=

Does anyone have any ideas for decoding them so they display correctly?

+1  A: 

This is MIME-encoded string mainly used for headers. You can find lots of libraries that can handle this. For example, get PEAR::mail and use this function,

Mail_mimeDecode::_decodeHeader()
ZZ Coder
+2  A: 

This is an RFC 2047 encoded-word. It is decoded by the mb_decode_mimeheader function.

bobince