
saaiber
Novice
Sep 21, 2006, 5:44 AM
Post #8 of 8
(10805 views)
|
Re: [saaiber] substitute \' in mail with '
[In reply to]
|
Can't Post
|
|
sub decode_qp ($) { my $res = shift; $res =~ s/\r\n/\n/g; # normalize newlines $res =~ s/[ \t]+\n/\n/g; # rule #3 (trailing space must be deleted) $res =~ s/=\n//g; # rule #5 (soft line breaks) if (ord('A') == 193) { # EBCDIC style machine if (ord('[') == 173) { $res =~ s/=([\da-fA-F]{2})/Encode::encode('cp1047',Encode::decode('iso-8859-1',pack("C", hex($1))))/ge; } elsif (ord('[') == 187) { $res =~ s/=([\da-fA-F]{2})/Encode::encode('posix-bc',Encode::decode('iso-8859-1',pack("C", hex($1))))/ge; } elsif (ord('[') == 186) { $res =~ s/=([\da-fA-F]{2})/Encode::encode('cp37',Encode::decode('iso-8859-1',pack("C", hex($1))))/ge; } } else { # ASCII style machine $res =~ s/=([\da-fA-F]{2})/pack("C", hex($1))/ge; } $res; } 1; This is being used to prevent =20 line breaks in incoming e-mails, now I guess that this line:
else { # ASCII style machine $res =~ s/=([\da-fA-F]{2})/pack("C", hex($1))/ge; } is responsible for the replacement. Big problem: any url wich ends with .php?p=2038#2038 in the mails is shown as .php?p%038#2038. This, off course, makes the url useless in the mail. Is there any possibility that I can tell this system not to touch URL's? This thing is driving me crazy ;) Nic
|