]> git.donarmstrong.com Git - debbugs.git/blobdiff - cgi/bugreport.cgi
use :raw for the mail messages
[debbugs.git] / cgi / bugreport.cgi
index 8ad688f6923b501ea836557574b2a63f881c738a..de4ec76371633cfe8d9760a14a7f6e2142df6250 100755 (executable)
@@ -8,6 +8,9 @@ BEGIN{
     delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
 }
 
+# STDOUT should be using the utf8 io layer
+binmode(STDOUT,':utf8');
+
 use POSIX qw(strftime);
 use MIME::Parser;
 use MIME::Decoder;
@@ -168,6 +171,7 @@ if (defined($msg) and ($msg-1) <= $#records) {
 }
 my @log;
 if ( $mbox ) {
+     binmode(STDOUT,":raw");
      my $date = strftime "%a %b %d %T %Y", localtime;
      if (@records > 1) {
         print $q->header(-type => "text/plain",
@@ -242,6 +246,7 @@ END
 
 else {
      if (defined $att and defined $msg and @records) {
+        binmode(STDOUT,":raw");
          $msg_num++;
          print handle_email_message($records[0]->{text},
                                     ref => $ref,