@matheusbsbs / matheus-bagliano / commits / 5ed5bbc7e1
Fork 0

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 <zfuzesi@eaglet.hu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Zoltán Füzesi committed Aug 2, 2009 at 09:42 UTC 5ed5bbc7e1c3a0144db42d6ec4689e01b2f37516
1 file changed +2 -3
gitweb/gitweb.perl
+2 -3
@@ -2570,7 +2570,7 @@ sub parse_commit_text {
2570 } elsif ((!defined $withparents) && ($line =~ m/^parent ([0-9a-fA-F]{40})$/)) {
2571 push @parents, $1;
2572 } elsif ($line =~ m/^author (.*) ([0-9]+) (.*)$/) {
2573 - $co{'author'} = $1;
2573 + $co{'author'} = to_utf8($1);
2574 $co{'author_epoch'} = $2;
2575 $co{'author_tz'} = $3;
2576 if ($co{'author'} =~ m/^([^<]+) <([^>]*)>/) {
@@ -2580,10 +2580,9 @@ sub parse_commit_text {
2580 $co{'author_name'} = $co{'author'};
2581 }
2582 } elsif ($line =~ m/^committer (.*) ([0-9]+) (.*)$/) {
2583 - $co{'committer'} = $1;
2583 + $co{'committer'} = to_utf8($1);
2584 $co{'committer_epoch'} = $2;
2585 $co{'committer_tz'} = $3;
2586 - $co{'committer_name'} = $co{'committer'};
2586 if ($co{'committer'} =~ m/^([^<]+) <([^>]*)>/) {
2587 $co{'committer_name'} = $1;
2588 $co{'committer_email'} = $2;