From: Jürgen Kreileder Date: Sat, 17 Dec 2011 09:22:21 +0000 (+0100) Subject: gitweb: Call to_utf8() on input string in chop_and_escape_str() X-Git-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/1b2c33db144b6b7efb1b35e2b36cddffc660f493537889bf6be9accd5f2f4ea3 gitweb: Call to_utf8() on input string in chop_and_escape_str() a) To fix the comparison with the chopped string, otherwise we compare bytes with characters, as chop_str() must run to_utf8() for correct operation b) To give the title attribute correct encoding; we need to mark strings as UTF-8 before outpur Signed-off-by: Jürgen Kreileder Acked-by: Jakub Narębski Signed-off-by: Junio C Hamano --- diff --git a/gitweb.perl b/gitweb.perl index 0dc7e27..33a89d5 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -1697,6 +1697,7 @@ sub chop_and_escape_str { my ($str) = @_; my $chopped = chop_str(@_); + $str = to_utf8($str); if ($chopped eq $str) { return esc_html($chopped); } else {