diff -Nru v1.17/dumpfile-to-rt-3.0 v1.17-my/dumpfile-to-rt-3.0
--- v1.17/dumpfile-to-rt-3.0	2003-07-25 09:21:08.000000000 +0400
+++ v1.17-my/dumpfile-to-rt-3.0	2003-07-25 21:28:09.000000000 +0400
@@ -597,25 +597,25 @@
 
             foreach my $a ( @{$attach} ) {
 
-                if ( $a->{'Headers'} =~ /^Content-Type: (.*?)$/m ) {
+                if ( $a->{'Headers'} =~ /^Content-Type: (?:.*?)$/mo ) {
                     my $content_type = $1;
-                    if ( $content_type =~ qr{(text/plain|message/rfc822)}i ) {
+                    if ( $content_type =~ qr{(?:text/plain|message/rfc822)}i ) {
                         my $enc;
                         if ( $content_type =~
-                            /charset=['"]?(.*?)(\s|\'|\"|;|$)/ )
+                            /charset=['"]?(.*?)(?:\s|\'|\"|;|$)/o )
                         {
                             $enc = $1;
                         }
                         else {
                             $enc = $ENCODING;    #DEFAULT;
                         }
-                        $enc =~ s/"'//gi;
+                        $enc =~ s/"'//go;
                         $enc = lc($enc);
                         unless ( $enc eq 'utf-8' || $enc eq 'utf8' ) {
                             use Encode;
                             eval {
-                                Encode::from_to( $a->{'Content'},
-                                    $enc => 'utf8' );
+                                $a->{'Content'} = decode($enc, $a->{'Content'});
+                                $a->{'Subject'} = decode($enc, $a->{'Subject'});
                                 $a->{'Headers'} .=
                                   "X-RT-Original-Encoding: $enc\n";
                             };
@@ -623,8 +623,8 @@
                                 warn $@;
                                 eval {
                                     $enc = $ENCODING;
-                                    Encode::from_to( $a->{'Content'},
-                                        $enc => 'utf8' );
+                                    $a->{'Content'} = decode($enc, $a->{'Content'});
+                                    $a->{'Subject'} = decode($enc, $a->{'Subject'});
                                     $a->{'Headers'} .=
                                       "X-RT-Original-Encoding: $enc\n";
                                 };
