]> git.donarmstrong.com Git - debbugs.git/blobdiff - examples/debian/postpa/22oldbugs
use UTF-8 encoding for 22oldbugs output
[debbugs.git] / examples / debian / postpa / 22oldbugs
index 09428a1f9462e0b37d6cac25db4f5842b2c9d554..126aa4686aac474bf87859f031db0bb9dfdb8889 100755 (executable)
@@ -45,7 +45,9 @@ count_bugs(function => sub {
     return () if @merged and $merged[0] < $d{bug};
 
     # 3600*24*30 (30 days)
-    my $cmonths = int(($startdate - $status->{date}) / 2592000);
+    my $cmonths = int(($startdate -
+                      length($status->{date})?$status->{date}:0) /
+                     2592000);
     if ($cmonths >= 24 && !length($status->{forwarded}) &&
            !$excludepackage{$d{pkg}}) {
        $oldpackage{$d{bug}} = $d{pkg};
@@ -62,6 +64,7 @@ my $nrbugs = keys %oldpackage;
 
 open OLDBUGS, '> /org/bugs.debian.org/www/stats/oldbugs.html.new'
     or die "can't open oldbugs.html.new: $!";
+binmode(OLDBUGS,':encoding(UTF-8)');
 print OLDBUGS <<EOF or die "can't write to oldbugs.html.new: $!";
 <html><head><title>Bugs Over Two Years Old</title></head>
 <body>