diff options
author | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2017-04-29 18:26:20 +0200 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2017-04-29 19:18:50 +0200 |
commit | 9c83796f45e634afd770b772a16209e1dbed7068 (patch) | |
tree | caeb4e06454e5c10c9e0b63d5076d47cb93577e8 /bin | |
parent | 146258f82fc15d0a5f8779447a4919429496e9e3 (diff) |
lo-commit-stat: default to utf8, adjust regex for tdf bugzilla
Change-Id: I61960512e297417eb096b3bc921974aa43f74ccc
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/lo-commit-stat | 14 |
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; } |