From 71474acbff8db38448ccec84c6154bb2a7fe363d Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw Date: Sun, 5 Oct 2008 21:48:51 +0000 Subject: Fixed the charset of the mailbody CVS version numbers check_trans.pl: 1.84 -> 1.85 --- check_trans.pl | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'check_trans.pl') diff --git a/check_trans.pl b/check_trans.pl index 65f47a9d8df..d72c59a0131 100755 --- a/check_trans.pl +++ b/check_trans.pl @@ -522,7 +522,7 @@ sub send_email # and attach the body to the mail my $part = MIME::Lite->new( 'Type' => 'text/plain', - 'Data' => $mailbody, + 'Data' => encode('utf-8',$mailbody), ); $part->attr( 'content-type.charset' => 'utf-8' ); $msg->attach( $part ); @@ -1202,26 +1202,13 @@ sub get_file_charset return $charset; } -# Slurp a file from a particular language in the right encoding sub read_file_enc { my $file = shift or croak("No file specified"); my $charset = get_file_charset( $file ); - # now read the file - open( my $fd, '<:bytes', $file ) or return undef; - my $text; - { - local $/ = undef; - $text = <$fd>; - } - close( $fd ); - - # decode the text - $text = decode( $charset, $text ); - - return $text; + return read_file( $file, $charset ); } __END__ -- cgit v1.2.3