aboutsummaryrefslogtreecommitdiffstats
path: root/check_trans.pl
diff options
context:
space:
mode:
authorBas Zoetekouw <bas>2008-10-05 21:48:51 +0000
committerBas Zoetekouw <bas>2008-10-05 21:48:51 +0000
commit71474acbff8db38448ccec84c6154bb2a7fe363d (patch)
treeec89ca9b8314d7734f075eb65b1b5039e22e5e21 /check_trans.pl
parent4dfccc5f70f19f35938872363e2a1eece13a0aa8 (diff)
Fixed the charset of the mailbody
CVS version numbers check_trans.pl: 1.84 -> 1.85
Diffstat (limited to 'check_trans.pl')
-rwxr-xr-xcheck_trans.pl17
1 files changed, 2 insertions, 15 deletions
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__

© 2014-2024 Faster IT GmbH | imprint | privacy policy