tags 659971 patch
thanks

One could use the (core) module I18N::Langinfo to decode 
$CONFIG{'owner'} from the user's locale to Perl's internal format. 

Also, since the template is expected to be in UTF-8, it needs to be 
converted as well.

Cheers,
-- 
Guilhem.
--- a/usr/bin/caff
+++ b/usr/bin/caff
@@ -321,6 +321,7 @@
 use Text::Template;
 use MIME::Entity;
 use Encode;
+use I18N::Langinfo;
 use Fcntl;
 use IO::Select;
 use Getopt::Long;
@@ -517,6 +518,10 @@
 	if ((defined $CONFIG{'also-encrypt-to'}) && ! (ref($CONFIG{'also-encrypt-to'}) eq 'ARRAY')) {
 		$CONFIG{'also-encrypt-to'} = [ $CONFIG{'also-encrypt-to'} ];
 	};
+	my $locale = Encode::find_encoding(langinfo(I18N::Langinfo::CODESET()));
+	if (defined $locale) {
+		$CONFIG{$_} = $locale->decode($CONFIG{$_}) for qw/owner mail-template/;
+	}
 };
 
 sub make_gpg_fds() {
@@ -801,7 +806,7 @@
 		Type        => "text/plain",
 		Charset     => "utf-8",
 		Disposition => 'inline',
-		Data        => $message);
+		Data        => Encode::encode('utf-8',$message));
 
 	my @key_entities;
 	for my $key (@keys) {

Attachment: signature.asc
Description: Digital signature

Reply via email to