git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-blame: Make the output human readable

From
Sergey Vlasov <vsu@altlinux.ru>
Date
Mar 8, 2006, 14:32 UTC
Message-ID
<20060308173249.1faed1d7.vsu@altlinux.ru>
In-Reply-To
<20060306193326.19262.qmail@science.horizon.com>
On 6 Mar 2006 14:33:26 -0500 linux@horizon.com wrote:
Show 13 quoted lines
> Well, getting 15 characters in UTF-8 is easy (just stop before the 16th
> byte for which ((b & 0xc0) != 0x80)), but what about combining characters?
> 
> You've got accents and stuff to worry about.  And the annoying fact that
> Unicode defined accents as suffixes, so you have to go past the 15th
> column to include all of the 
> 
> And then there's that fact that many characters are traditionally
> represented as double-wide forms, even on character terminals.
> 
> See http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c for details
> an an example implementation of wcwidth().
> 
[skip]
> 			/* Now find the width of it */
> 			w = wcwidth(c);

And this won't work, unless you also add that wcwidth() implementation to git.

The problem is that the wchar_t encoding is not specified anywhere - glibc uses Unicode for it, but other systems can use whatever they want (even locale-dependent).

Previous: linux@horizon.comNext: linux@horizon.com
Message 2 of 5 in “Re: [PATCH] git-blame: Make the output human readable”
  1. linux@horizon.comMar 6, 2006
  2. Sergey VlasovMar 8, 2006
  3. linux@horizon.comMar 8, 2006
  4. Sergey VlasovMar 8, 2006
  5. linux@horizon.comMar 8, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.