]> git.donarmstrong.com Git - debbugs.git/commitdiff
Merge branch 'master' of git+ssh://git.donarmstrong.com/srv/git/debbugs
authorDon Armstrong <don@donarmstrong.com>
Thu, 14 Mar 2013 22:04:07 +0000 (15:04 -0700)
committerDon Armstrong <don@donarmstrong.com>
Thu, 14 Mar 2013 22:04:07 +0000 (15:04 -0700)
Debbugs/Control.pm
Debbugs/Log.pm
Debbugs/Status.pm
scripts/gen-indices
scripts/process
t/13_utf8_mail.t

index 4b3a02aa37daea67e05c609e2a44f35fd25a4747..0390ba72cc6290a7da86ad382c05819bf215311c 100644 (file)
@@ -3467,7 +3467,7 @@ sub append_action_to_log{
      $msg = '';
      if ((ref($param{message}) and @{$param{message}}) or length($param{message})) {
         push @records, {type => exists $param{recips}?'recips':'incoming-recv',
-                        exists $param{recips}?(recips => [make_list($param{recips})]):(),
+                        exists $param{recips}?(recips => [map {encode_utf8_safely($_)} make_list($param{recips})]):(),
                         text => join('',make_list($param{message})),
                        };
      }
index 8b99b7de7a097207ffbe6abff3848edeae63fe52..551fd392a36fafea8b452377e30f19dbdc20d266 100644 (file)
@@ -405,6 +405,15 @@ sub write_log_records
            if (defined $recips) {
                croak "recips not undef or array"
                    unless ref($recips) eq 'ARRAY';
+                my $wrong_encoding = 0;
+                my @recips =
+                    map { if (is_utf8($_)) {
+                        $wrong_encoding=1;
+                        encode_utf8($_);
+                    } else {
+                        $_;
+                    }} @$recips;
+                carp('Recipients was in the wrong encoding (perl internal instead of utf8 octets') if $wrong_encoding;
                print {$logfh} join("\04", @$recips) . "\n" or
                    die "Unable to write to logfile: $!";
            } else {
index 7d72c032ec9b68c8678bca33acd2eacfd7707748..c66ab416805c37bdf9f5e3ed28ce4e292e28ba5a 100644 (file)
@@ -1615,6 +1615,7 @@ sub update_realtime {
        my $idx_new = IO::File->new($file.'.new','w')
             or die "Couldn't open ${file}.new: $!";
 
+        binmode($idx_new,':raw:encoding(UTF-8)');
        my $min_bug = min(keys %bugs);
        my $line;
        my @line;
index 0fe8ea82fcb577304cebacc374e385832e8ba6a3..7a8670d96ffb8c69fe90e73185e78a156792183b 100755 (executable)
@@ -83,6 +83,7 @@ use Debbugs::Config qw(:config);
 use Debbugs::Common qw(getparsedaddrs getbugcomponent lockpid);
 use Debbugs::Status qw(readbug split_status_fields);
 use Debbugs::Log;
+use Debbugs::UTF8 qw(encode_utf8_structure);
 
 chdir($config{spool_dir}) or die "chdir $config{spool_dir} failed: $!";
 
@@ -198,7 +199,7 @@ while (my $dir = shift @dirs) {
                     next;
                }
                next if $stat->mtime < $time;
-               my $fdata = split_status_fields(readbug($bug, $initialdir));
+               my ($fdata) = encode_utf8_structure(split_status_fields(readbug($bug, $initialdir)));
                $modification_made = 1;
                addbugtoindex("package", $bug, make_list($fdata->{package}));
                addbugtoindex("tag", $bug, make_list($fdata->{keywords}));
index 73eebb0c19bf81a441d9876d848dfd1c06be4495..17aa15be7b297939a66e8ea97e1eff656fbf4645 100755 (executable)
@@ -1207,7 +1207,7 @@ sub sendmessage {
     write_log_records(logfh => $logfh,
                      records => {text => stripbccs($msg),
                                  type => 'recips',
-                                 recips => [@{$recips}],
+                                 recips => [map {encode_utf8($_)} @{$recips}],
                                 },
                     );
     if (ref($bcc)) {
index 4eda888df35cd0b67dbd0a8f5776342317d9f7f4..d5397dc9a5e492d5c77e12d37c86cff05d43b508 100644 (file)
@@ -53,7 +53,7 @@ END{
 
 send_message(to=>'submit@bugs.something',
             headers => [To   => 'submit@bugs.something',
-                        From => 'foo@bugs.something',
+                        From => 'foöff@bugs.something',
                         Subject => 'Submiting a bug',
                        ],
             body => <<EOF,attachments => [{Type=>"text/plain",Charset=>"utf-8",Data=><<EOF2}]) or fail('Unable to send message');