All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Peter Krefting <peter@softwolves.pp.se>
Cc: "Torsten Bögershausen" <tboegi@web.de>,
	"Git Mailing List" <git@vger.kernel.org>,
	kevin@bracey.fi
Subject: Re: [PATCH 2/2] Make it possible to update git_wcwidth()
Date: Mon, 12 May 2014 10:44:05 -0700	[thread overview]
Message-ID: <xmqqegzyu96f.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1405121334480.9884@ds9.cixit.se> (Peter Krefting's message of "Mon, 12 May 2014 13:38:37 +0100 (CET)")

Peter Krefting <peter@softwolves.pp.se> writes:

> 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).

  reply	other threads:[~2014-05-12 18:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-09 21:51 [PATCH 2/2] Make it possible to update git_wcwidth() Torsten Bögershausen
2014-05-12 12:38 ` Peter Krefting
2014-05-12 17:44   ` Junio C Hamano [this message]
2014-05-12 17:54 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqegzyu96f.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=kevin@bracey.fi \
    --cc=peter@softwolves.pp.se \
    --cc=tboegi@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.