decoding technique in incoming email


I'm writing some custom code to analyze spam for incoming mail to our mail server.  I need to know what the following encoding method is from the text snippet below.  Have tried several things (UTF-8, MIME, etc) and haven't had any success so far:

Subject: =?UTF-8?B?8J+OgSBCbGFjayBGcmlkYXkgaXMgT04u?=


Ben ConnerCTO, SAS developerAsked:
Who is Participating?
Dr. KlahnPrincipal Software EngineerCommented:
According to

this is UTF-8 encoded base-64.  There's a PHP example as well.

"The encoding must be either B or Q, these mean base 64 and quoted-printable respectively. You can read the RFC 1342 document for more information about how they work."

If it doesn't decode to printable ... well, I wouldn't be surprised.  After all, it is spam, and it's trying every conceivable way to get somebody's attention.
Ben ConnerCTO, SAS developerAuthor Commented:
LOL, this case, I don't think it was spam.  Had captured the email temporarily to a client and it was from a major store.  But mail clients have to be able to figure out how to decode them, so it must be doable.

Thanks so much!  Way too much to keep track of...

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.