cormanaz has asked for the wisdom of the Perl Monks concerning the following question:

Good day bros. I am trying to use Mail::POP3Client to get and process some Google alerts. The the response in Windows-1252 charset, and I'm having trouble getting the body decoded. There doesn't seem to be any decoder or charset function in POP3Client. How do I get this blasted thing decoded?

UPDATE: Oh yeah, I forgot...I tried mod Encode, i.e. $body = decode("Windows-1252",$pop->Body($i)); but I'm still getting the strange encodings, for example:

<p style=3D"width:600px"> <a style=3D"color: #00f" href=3D"http://www.politicalforum.com/showthread.php?t=3D37132"> Defining propaganda: One man=92s truth is another man=92s propaganda</ +a><br>= <font size=3D-1> <font color=3D#666666>By BuckNaked </font><br>
Many thanks... Steve

Replies are listed 'Best First'.
Re: Mail::POP3Client Windows-1252 decoding
by almut (Canon) on Jun 04, 2008 at 20:14 UTC
      MIME::QuotedPrint did it. Thanks you. MIME::Decoder seems to work only with filehandles.
        True, but it's pretty easy to use a scalar variable as a file:
        open(my $fh, ">", \my $text); $decoder->decode(\*DATA, $fh); print "decoded text = $text\n";
Re: Mail::POP3Client Windows-1252 decoding
by pc88mxer (Vicar) on Jun 04, 2008 at 20:02 UTC
    This looks like it is encoded with MIME's quoted-printable encoding. Look up the CPAN module MIME::Decoder.