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

Re: [PATCH 2/2] Make it possible to update git_wcwidth()

From
Junio C Hamano <gitster@pobox.com>
Date
May 12, 2014, 17:44 UTC
Message-ID
<xmqqegzyu96f.fsf@gitster.dls.corp.google.com>
In-Reply-To
<alpine.DEB.2.00.1405121334480.9884@ds9.cixit.se>
Peter Krefting <peter@softwolves.pp.se> writes:
Show 23 quoted lines
> Torsten Bögershausen:
>
>> The function git_wcwidth() returns for a given unicode code point the
>> width on the display:
>> -1 for control characters,
>> 0 for combining or other non-visible code points
>> 1 for e.g. ASCII
>> 2 for double-width code points.
>
> This all looks sane, but the problem is that this is also
> context-dependent since there are a lot of characters with "ambiguous"
> widths, i.e., characters that are "double" width for CJK locales (and
> fonts), but "single" width for others. This includes Greek and
> Cyrillic characters, which are encoded using the double-byte parts of
> the CJK DBCS encodings.
>
> I'm not quite sure how much impact this would have on day-to-day Git
> operation in a CJK locale, however, as I guess they would mostly
> encounter texts in their own language (which would mostly be "double"
> width) or English (which would be unambiguously "single" width).
>
> Anyone on the list running Git in a CJK locale that would like to
> weigh in here?

The issue does appear in the real life. A solution I've seen used in a terminaul emulator program was to give the user a choice to say "I want ambiguous ones to be treated as double (or single)". As a J-locale user, I naturally set the configuration to double while using that program (I no longer do).

Previous: Peter KreftingNext: Junio C Hamano
Message 3 of 4 in “Make it possible to update git_wcwidth()”
  1. 2/2 Make it possible to update git_wcwidth()Torsten Bögershausen, May 9, 2014
  2. Peter KreftingMay 12, 2014
  3. Junio C HamanoMay 12, 2014
  4. Junio C HamanoMay 12, 2014

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.