X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gitweb%2Fgitweb.perl;h=8308e2208e2a0064724367f3bcb6d33282b9e587;hb=6304c29d518206b0780291a02f94f435abf82d74;hp=2facf2db7a9cd034476fa65496ef575f3073c6df;hpb=3562198b7da7ef6597af27b3a7fcaeee41608999;p=git.git diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 2facf2db7..8308e2208 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -866,6 +866,10 @@ sub chop_str { my $add_len = shift || 10; my $where = shift || 'right'; # 'left' | 'center' | 'right' + # Make sure perl knows it is utf8 encoded so we don't + # cut in the middle of a utf8 multibyte char. + $str = to_utf8($str); + # allow only $len chars, but don't cut a word if it would fit in $add_len # if it doesn't fit, cut it if it's still longer than the dots we would add # remove chopped character entities entirely