Skip to content

Commit 5ed5bbc

Browse files
Zoltán Füzesigitster
authored andcommitted
gitweb: parse_commit_text encoding fix
Call to_utf8 when parsing author and committer names, otherwise they will appear with bad encoding if they written by using chop_and_escape_str. Signed-off-by: Zoltán Füzesi <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0a53e9d commit 5ed5bbc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

gitweb/gitweb.perl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2570,7 +2570,7 @@ sub parse_commit_text {
25702570
} elsif ((!defined $withparents) && ($line =~ m/^parent ([0-9a-fA-F]{40})$/)) {
25712571
push @parents, $1;
25722572
} elsif ($line =~ m/^author (.*) ([0-9]+) (.*)$/) {
2573-
$co{'author'} = $1;
2573+
$co{'author'} = to_utf8($1);
25742574
$co{'author_epoch'} = $2;
25752575
$co{'author_tz'} = $3;
25762576
if ($co{'author'} =~ m/^([^<]+) <([^>]*)>/) {
@@ -2580,10 +2580,9 @@ sub parse_commit_text {
25802580
$co{'author_name'} = $co{'author'};
25812581
}
25822582
} elsif ($line =~ m/^committer (.*) ([0-9]+) (.*)$/) {
2583-
$co{'committer'} = $1;
2583+
$co{'committer'} = to_utf8($1);
25842584
$co{'committer_epoch'} = $2;
25852585
$co{'committer_tz'} = $3;
2586-
$co{'committer_name'} = $co{'committer'};
25872586
if ($co{'committer'} =~ m/^([^<]+) <([^>]*)>/) {
25882587
$co{'committer_name'} = $1;
25892588
$co{'committer_email'} = $2;

0 commit comments

Comments
 (0)