hello,
i am downloading email with perl from a pop server. until now I haven't had any problems being able to read subject lines, that is to say I can read the letters and numbers and so forth, even though sometimes subjects are complete gibberish.
anyhow, i've been getting several emails that contain what I believe is a UTF16 string embeded in the subject header.
as it appears on the webmail's (hotmail) view source:
(all on one line)Subject: username, A Ne=?UTF-16?B?dwAgAEMAcgBlAGQAaQB0ACAAQwBhAHIAZAAg +AEMAbwB1AGwAZAAgAEIAZQAgAEgAZQBhAGQAZQBkACAAWQBvAHUAcgAgAFcAYQB5AA==? +=
which is also exactly how the data looks like when downloaded via pop
when viewing that specific email in a browser on hotmail, the "A Ne*string*" appears as:
A New Credit Card Could Be Headed Your Way
now I just can't figure out for the life of me how I'm supposed to decode that string. I'll use regex to grab the ?UTF part and then decode it:
print decode( "UTF-16be", $string ), "\n";but all that returns is a bunch of non english (japanese i think) characters and symbols
what is the proper way to decode that string so as i could actually read out the proper subject?
In reply to decoding a UTF-16B string found in an email subject by neaj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |