Rick Becker
asked on
500pts - Need help decoding an encoded e-mail Subject Line... Mime??
Greetings all,
I have a routine that I have been using to 'Parse' email as it arrives. It mainly looks at the 'Subject' line to determine if it is something that I need to read and parse further.
Quite frankly I'm parsing email from Amazon. I look for 'Sold - ship now' to determine if an item has sold and I print a mailing lable for it as soon as I parse the email for name and address.
The problem is that Amazon has now encoded the subject line so that when I read the 'raw' data I no longer 'see' the "Sold - ship now" string that I was originally parsing.
I have tried to decode the string with /usr/local/bin/base64 but that results in an error telling me that '?' are not proper for base64.
So I need to know if there is a 'C' function available that will decode this mime type. The following is the encoded string and what the decoded string should say: (with out the quotes)
"=?iso-8859-1?B?U29sZCwgc2 hpcCBub3cu IDAwNi0xMD EgQW5vdGhl ciBCZWdpbm 5pbmcgW0F1 ZGlvIENEXS BSb2NrRm91 ciA=?="
"Sold, ship now. 006-101 Another Beginning [Audio CD] RockFour"
Any help would be appreciated,
rrbecker
BTW - This running on a FreeBSD box....
I have a routine that I have been using to 'Parse' email as it arrives. It mainly looks at the 'Subject' line to determine if it is something that I need to read and parse further.
Quite frankly I'm parsing email from Amazon. I look for 'Sold - ship now' to determine if an item has sold and I print a mailing lable for it as soon as I parse the email for name and address.
The problem is that Amazon has now encoded the subject line so that when I read the 'raw' data I no longer 'see' the "Sold - ship now" string that I was originally parsing.
I have tried to decode the string with /usr/local/bin/base64 but that results in an error telling me that '?' are not proper for base64.
So I need to know if there is a 'C' function available that will decode this mime type. The following is the encoded string and what the decoded string should say: (with out the quotes)
"=?iso-8859-1?B?U29sZCwgc2
"Sold, ship now. 006-101 Another Beginning [Audio CD] RockFour"
Any help would be appreciated,
rrbecker
BTW - This running on a FreeBSD box....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi again cwwkie,
That works great.... Again thanks for the insite.
rrbecker
That works great.... Again thanks for the insite.
rrbecker
If you run into more encoding problems, I can recommend the leetkey extention (http://leetkey.mozdev.org/) for firefox.
With that you can play in your browser encoding and decoding data. Very handy!
With that you can play in your browser encoding and decoding data. Very handy!
ASKER
Hi cwwkie,
" ...I can recommend the leetkey extention...."
Thanks, for the link. I don't generally use Firefox but I'll fire it up and thake a look.
Again thanks,
rrbecker
" ...I can recommend the leetkey extention...."
Thanks, for the link. I don't generally use Firefox but I'll fire it up and thake a look.
Again thanks,
rrbecker
ASKER
Wow... Thanks for the tip and insight. I'll try it here in a bit and get back to you.
Again thanks....
rrbecker