--- Kernel/System/Email.pm	2005-07-18 16:32:33.000000000 +0200
+++ Kernel/System/Email.pm.20050718-nodebug	2005-07-18 16:31:13.000000000 +0200
@@ -18,6 +18,8 @@
 use Kernel::System::Encode;
 use Kernel::System::Crypt;
 
+use Kernel::UniStringEnc;
+
 use vars qw($VERSION);
 $VERSION = '$Revision: 1.12 $';
 $VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/;
@@ -208,7 +210,15 @@
             $Param{Body} = $Body;
         }
     }
-
+    
+    # handle email charset
+    my $OldCharset = undef;
+    my $ForcedCharset = $Self->{ConfigObject}->Get('EmailForcedCharset');
+    if( defined($ForcedCharset) && ($Param{Charset} ne $ForcedCharset) ) {
+        $OldCharset = $Param{Charset};
+        $Param{Charset} = $ForcedCharset;
+    }
+    
     # build header
     my %Header = ();
     foreach (qw(From To Cc Bcc Subject Charset Reply-To)) {
@@ -224,6 +234,10 @@
     # do some encode
     foreach (qw(From To Cc Bcc Subject)) {
         if ($Header{$_} && $Param{Charset}) {
+            if( $OldCharset ) {
+                # use proper encode for header
+                # ... or now do nothing since it's screwed up anyway ;)
+            }
             $Header{$_} = encode_mimewords($Header{$_}, Charset => $Param{Charset}) || '';
         }
     }
@@ -256,7 +270,17 @@
         $Header{'Organization'} = $Self->{Organization};
     }
     # body encode
-    $Self->{EncodeObject}->EncodeOutput(\$Param{Body});
+    if( $OldCharset ) {
+        # if we force the charset let's recode the email
+        # default input/output charset is the wanted one
+        my $UniString = new Kernel::UniStringEnc( $Param{Charset} );
+        # body is encoded using OldCharset
+        $UniString->set( $Param{Body}, $OldCharset );
+        $Param{Body} = $UniString->get();
+    } else {
+        # the old way otherwise
+        $Self->{EncodeObject}->EncodeOutput(\$Param{Body});
+    }
     # build MIME::Entity
     my $Entity = MIME::Entity->build(%Header, Data => $Param{Body});
 
