]> Lady’s Gitweb - Gitweb/commit
gitweb: Convert string to internal form before chopping in chop_str
authorAnders Waldenborg <redacted>
Wed, 21 May 2008 11:44:43 +0000 (13:44 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:33 +0000 (00:07 -0400)
commitd003f6928cacd7aa42f6a5e9ea285373c548c81d6da67818975245db047d3849
tree320592e5f61e6ae2202e76d616e0191baebe7c2908470fc5db7138c2bb90cdf7
parent069b78426769040f09cf16fb7188a8e02b0fc415643a5b60a5d092703ee13132
gitweb: Convert string to internal form before chopping in chop_str

Fix chop_str not to cut in middle of utf8 multibyte chars. Without
this fix at least author name in short log may cut in middle of a
multibyte char. When the result comes to esc_html to_utf8 is called
again, which doesn't find valid utf8 and decodes using
$fallback_encoding making it even worse.

This also have the nice side effect that it actually tries to show the
first 10 _characters_, not the number of characters that happened to fit
into 10 bytes.

Signed-off-by: Anders Waldenborg <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl
This page took 0.176779 seconds and 4 git commands to generate.