X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Tue, 12 May 2009 19:31:53 +0200
From: Corinna Vinschen <vinschen@redhat.com>
To: newlib@sourceware.org, cygwin@cygwin.com
Subject: Re: [Fwd: [1.7] wcwidth failing configure tests]
Message-ID: <20090512173153.GY21324@calimero.vinschen.de>
Reply-To: newlib@sourceware.org
Mail-Followup-To: newlib@sourceware.org, cygwin@cygwin.com
References: <20090512165404.GW21324@calimero.vinschen.de> <416096c60905120956n5521929bm69586f5e6325a994@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <416096c60905120956n5521929bm69586f5e6325a994@mail.gmail.com>
User-Agent: Mutt/1.5.19 (2009-02-20)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On May 12 17:56, Andy Koppe wrote:
> > And here's another question.  The utf8*.h files claim they have been
> > generated from the unicode.txt file of the Unicode 3.2 standard.  Do we
> > have the script which generated the utf8*.h files?  Can we regenerate
> > the files to match the current Unicode 5.1 standard?
> 
> There's Markus Kuhn's wcwidth implementation, which says it's based on
> Unicode 5.0:
> 
> http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c

This looks nice.

> Trouble is, there's the thorny issue of the "CJK Ambiguous Width"
> category of characters, which consists of things like Greek and
> Cyrillic letters as well as line drawing symbols. Those have a width
> of 1 in Western use, yet with CJK fonts they have a width of 2. That's
> why Markus Kuhn's code includes the mk_wcswidth_cjk() variant.

We should use the standard variation alone, imho.

And we need some workaround for UTF-16 systems like Cygwin.
Unfortunately, surrogate pairs only work well as part of a string, not
as standalone chars.  So wcwidth would return -1 for each single char,
but wcswidth could be tweaked to handle them gracefully.


Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

