summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2017-04-29 18:26:20 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2017-08-02 12:09:17 +0200
commitcbd3c09e29df72a05025c117def44fbcc1163f20 (patch)
tree457fd4ca16bc1761e417a5f7a8f830b2207b7fb0
parent39092ed597bbe3653638736f61748843ddc1cc99 (diff)
lo-commit-stat: default to utf8, adjust regex for tdf bugzilla
Change-Id: I61960512e297417eb096b3bc921974aa43f74ccc (cherry picked from commit 9c83796f45e634afd770b772a16209e1dbed7068)
-rwxr-xr-xbin/lo-commit-stat14
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat
index a4e3f7d1ae32..ca3aa638644b 100755
--- a/bin/lo-commit-stat
+++ b/bin/lo-commit-stat
@@ -7,6 +7,9 @@ use strict;
use LWP::UserAgent;
use utf8;
use File::Temp;
+use Encode;
+use open ':encoding(utf8)';
+use open ':std' => ':encoding(utf8)';
my %module_dirname = (
"core" => "",
@@ -381,19 +384,16 @@ sub get_bug_name($$)
$ua->env_proxy;
my $response = $ua->get($url);
if ($response->is_success) {
- my $title = $response->title;
- if ( $title =~ s/^Bug \d+ \S+ // ) {
+ my $title = decode('utf8', $response->title);
+ if ( $title =~ s/^(?:Bug $bug_number \S+|$bug_number –) // ) {
print "$title\n";
return $title;
} else {
- print "warning: not found; using commit message (only got $title)\n";
+ print "warning: not found; using commit message (only got $title)";
}
- } else {
- print "\n";
}
- } else {
- print "\n";
}
+ print "\n";
return $summary;
}