]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: parse_commit_text encoding fix
authorZoltán Füzesi <redacted>
Sun, 2 Aug 2009 07:42:24 +0000 (09:42 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:50:39 +0000 (00:50 -0400)
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index e5ca381b20c3231c967f757157a9c9dcd8facdb4d1baa2e93d968ba6bb4d1da3..3eb82ef97a48c19e543cce6ff127774bfa2fdbbeee38e2005e2a392055312634 100755 (executable)
@@ -2574,7 +2574,7 @@ sub parse_commit_text {
                } elsif ((!defined $withparents) && ($line =~ m/^parent ([0-9a-fA-F]{40})$/)) {
                        push @parents, $1;
                } elsif ($line =~ m/^author (.*) ([0-9]+) (.*)$/) {
-                       $co{'author'} = $1;
+                       $co{'author'} = to_utf8($1);
                        $co{'author_epoch'} = $2;
                        $co{'author_tz'} = $3;
                        if ($co{'author'} =~ m/^([^<]+) <([^>]*)>/) {
@@ -2584,10 +2584,9 @@ sub parse_commit_text {
                                $co{'author_name'} = $co{'author'};
                        }
                } elsif ($line =~ m/^committer (.*) ([0-9]+) (.*)$/) {
-                       $co{'committer'} = $1;
+                       $co{'committer'} = to_utf8($1);
                        $co{'committer_epoch'} = $2;
                        $co{'committer_tz'} = $3;
-                       $co{'committer_name'} = $co{'committer'};
                        if ($co{'committer'} =~ m/^([^<]+) <([^>]*)>/) {
                                $co{'committer_name'}  = $1;
                                $co{'committer_email'} = $2;
This page took 0.250722 seconds and 4 git commands to generate.