Convert ISO-8859-1 (quoted-printable) to 8 bit

Discussion in 'Perl Misc' started by Fred, Nov 24, 2003.

  1. Fred

    Fred Guest

    I use the following code to remove ISO-8859-1 from mail message-headers:

    use MIME::QuotedPrint ;
    $message =~ s/(Subject: |From: |Sender: |To: )
    (\w*?)=\?ISO-8859-1\?[A-Z]\?(.+?)\?=/$1 $2$3/ig ;

    if ($message =~ m/=[A-Za-z0-9]{2}/g ) {
    $message =~ s/(=[A-Za-z0-9]{2})/decode_qp $1/ge ;
    $message =~ s/Content-Transfer-Encoding:
    quoted-printable/Content-Transfer-Encoding: binary/g ;

    This works fine most of the time. However I am wondering if there is a
    module which can do the job better.
    Fred, Nov 24, 2003
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.