Changeset 3627
- Timestamp:
- 2002-12-09T14:52:41+13:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/EMAILPlug.pm
r3540 r3627 669 669 # the RFC also mentions "parallel". 670 670 } 671 } # end of ($mimetype !~ multipart)671 } # end of ($mimetype =~ multipart) 672 672 elsif ($mimetype =~ m@message/rfc822@) { 673 673 my $msg_header = $text; … … 769 769 my $text=shift; 770 770 771 my @lines=split('\n', $text);772 773 771 # if a line ends with "=\s*", it is a soft line break, otherwise 774 772 # keep in any newline characters. 775 foreach my $line (@lines) { 776 if ($line !~ s/=\s*$//) {$line.="\n";} 777 778 if ($line =~ /=[0-9A-Fa-f]{2}/) { # it contains an escaped char 779 my @hexcode_segments=split('=',$line); 780 shift @hexcode_segments; 781 my @hexcodes; 782 foreach my $hexcode (@hexcode_segments) { 783 $hexcode =~ s/^(..).*$/$1/; # only need first 2 chars 784 chomp($hexcode); # just in case... 785 my $char=chr (hex "0x$hexcode"); 786 $line =~ s/=$hexcode/$char/g; 787 } 788 } 789 } 790 $text= join('', @lines); 773 774 $text =~ s/=\s*\r?\n//mg; 775 $text =~ s/=([0-9A-Fa-f]{2})/chr (hex "0x$1")/eg; 791 776 return $text; 792 777 }
Note:
See TracChangeset
for help on using the changeset viewer.