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

Re: [PATCH] builtin-blame.c: Use utf8_strwidth for author's names

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 1, 2009, 22:34 UTC
Message-ID
<alpine.DEB.1.00.0902012333060.3586@pacific.mpi-cbg.de>
In-Reply-To
<alpine.DEB.2.00.0901301710130.1984@vinegar-pot.mit.edu>
Hi,
On Fri, 30 Jan 2009, Geoffrey Thomas wrote:
Show 6 quoted lines
> Currently, however, printf("%*.*s", width, width, author) is simply 
> wrong, because printf only cares about bytes, not screen columns. Do you 
> think I should fall back on the old behavior if i18n.commitencoding is 
> set, or if at least one of the author names isn't parseable as UTF-8, or 
> something? Or should I be doing this with iconv and assuming all commits 
> are encoded in the current encoding specified via $LANG or $LC_whatever?

I do not know what encoding the author is at that point, but if you cannot be sure that it is UTF-8, using utf8_strwidth() is just as wrong as the current code, IMHO.

Ciao, Dscho

Previous: Jeff KingNext: Junio C Hamano
Message 6 of 13 in “utf8: add utf8_strwidth()”
  1. utf8: add utf8_strwidth()Geoffrey Thomas, Jan 30, 2009
  2. builtin-blame.c: Use utf8_strwidth for author's namesGeoffrey Thomas, Jan 30, 2009
  3. Johannes SchindelinJan 30, 2009
  4. Geoffrey ThomasJan 30, 2009
  5. Jeff KingJan 31, 2009
  6. Johannes SchindelinFeb 1, 2009
  7. Junio C HamanoFeb 2, 2009
  8. Johannes SchindelinFeb 2, 2009
  9. Junio C HamanoFeb 3, 2009
  10. Jeff KingFeb 2, 2009
  11. Jeff KingJan 31, 2009
  12. Geoffrey ThomasJan 31, 2009
  13. Jeff KingJan 31, 2009

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.