gitweb: Convert string to internal form before chopping in chop_str
authorAnders Waldenborg <anders@0x63.nu>
Wed, 21 May 2008 11:44:43 +0000 (13:44 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 23 May 2008 06:03:43 +0000 (23:03 -0700)
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 <anders@0x63.nu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found