From: Jeff King Date: Sat, 31 Jan 2009 08:56:52 GMT Subject: Re: [PATCH] utf8: add utf8_strwidth() Message-ID: <20090131085652.GA6484@coredump.intra.peff.net> In-Reply-To: On Sat, Jan 31, 2009 at 03:51:48AM -0500, Geoffrey Thomas wrote: > On Sat, 31 Jan 2009, Jeff King wrote: >> I know next to nothing about our encoding functions, but this seems >> suspiciously similar to utf8_width in utf8.c. There is also a >> git_wcwidth, but I don't know how they relate. > > git_wcwidth determines the screen columns of a single ucs_char_t. > utf8_width returns the git_wcwidth of the first character in a string. > utf8_strwidth (the function added by this patch) is a simple loop around > utf8_width, because writing the loop every time would be silly. Urgh. Sorry. If I had taken 3 seconds to actually _look_ at your patch, I would have seen that (instead I thought "don't we already have something that does this" and went straight to the existing code). But no, it looks like we don't already have this, so your patch is fine. Sorry for the noise. -Peff