From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20015 invoked from network); 21 Jan 2008 14:16:08 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 21 Jan 2008 14:16:08 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 73572 invoked from network); 21 Jan 2008 14:16:05 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 21 Jan 2008 14:16:05 -0000 Received: (qmail 28271 invoked by alias); 21 Jan 2008 14:16:02 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24416 Received: (qmail 28248 invoked from network); 21 Jan 2008 14:16:01 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 21 Jan 2008 14:16:01 -0000 Received: from virusfilter.dotsrc.org (bifrost [127.0.0.1]) by spamfilter.dotsrc.org (Postfix) with ESMTP id 157598058F58 for ; Mon, 21 Jan 2008 15:15:48 +0100 (CET) Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [217.69.20.190]) by bifrost.dotsrc.org (Postfix) with ESMTP for ; Mon, 21 Jan 2008 15:15:47 +0100 (CET) Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly43d.srv.mailcontrol.com (MailControl) with ESMTP id m0LEFZkI020350 for ; Mon, 21 Jan 2008 14:15:46 GMT Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Mon, 21 Jan 2008 14:15:40 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.1/8.13.4) with ESMTP id m0LEFewc017358 for ; Mon, 21 Jan 2008 14:15:40 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.14.1/8.14.1/Submit) with ESMTP id m0LEFbbU017355 for ; Mon, 21 Jan 2008 14:15:40 GMT Message-Id: <200801211415.m0LEFbbU017355@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk Subject: Re: Unicode problem In-reply-to: References: <20080117120932.4458d35a@news01> Comments: In-reply-to =?UTF-8?Q?J=C3=B6rg?= Sommer message dated "Mon, 21 Jan 2008 13:33:57 +0000." Date: Mon, 21 Jan 2008 14:15:37 +0000 From: Peter Stephenson X-OriginalArrivalTime: 21 Jan 2008 14:15:40.0168 (UTC) FILETIME=[19D9B080:01C85C38] X-Scanned-By: MailControl A-06-00-00 (www.mailcontrol.com) on 10.68.0.153 X-Virus-Scanned: ClamAV using ClamSMTP > The zero width character is drawn with width one? Yes, that's what gnome-terminal is doing. It seems to agree with the screen width the library code is reporting (I didn't check explicitly but the behaviour is consistent with that). I think there are actually two widths involved here: the screen width used with a fixed-size font for editing (applicable to zsh), and the logical width of the character that would appear in a document. The latter is typically different to the former (in particular when a variable width font is in use), and it's the latter case where it needs to be zero width. There's a kind of hybrid case for a WYSIWYG word processor where it needs to flag up the space for editing even though pretending it's behaving as zero-width, but this is a special case of variable-width fonts. The information in the library as returned by wcwidth() is only applicable to fixed width fonts, where "zero width" is essentially meaningless; a character width must be 1, 2, ... So I think gnome-terminal is doing the right thing here, although I can understand the confusion. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070