F
Fred
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.
....
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.