From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8794 invoked from network); 10 Feb 2005 14:22:22 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 10 Feb 2005 14:22:22 -0000 Received: (qmail 98125 invoked from network); 10 Feb 2005 14:22:14 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 10 Feb 2005 14:22:14 -0000 Received: (qmail 21077 invoked by alias); 10 Feb 2005 14:22:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20803 Received: (qmail 21065 invoked from network); 10 Feb 2005 14:22:10 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 10 Feb 2005 14:22:10 -0000 Received: (qmail 97833 invoked from network); 10 Feb 2005 14:22:10 -0000 Received: from mailhost1.csr.com (HELO MAILSWEEPER01.csr.com) (81.105.217.43) by a.mx.sunsite.dk with SMTP; 10 Feb 2005 14:22:04 -0000 Received: from exchange03.csr.com (unverified [10.100.137.60]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Thu, 10 Feb 2005 14:20:38 +0000 Received: from news01.csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 10 Feb 2005 14:22:27 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.1/8.12.11) with ESMTP id j1AEM4jQ005981 for ; Thu, 10 Feb 2005 14:22:04 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.13.1/8.13.1/Submit) with ESMTP id j1AEM3Zx005978 for ; Thu, 10 Feb 2005 14:22:03 GMT Message-Id: <200502101422.j1AEM3Zx005978@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: Zsh hackers list Subject: Re: UTF-8 input [was Re: PATCH: zle_params.c] In-reply-to: <1050130063525.ZM24312@candle.brasslantern.com> References: <200501261806.j0QI6Q2d021854@news01.csr.com> <20050129034740.GA21742@scowler.net> <20050130010754.6F985863A@pwstephenson.fsnet.co.uk> <1050130063525.ZM24312@candle.brasslantern.com> Date: Thu, 10 Feb 2005 14:22:03 +0000 From: Peter Stephenson X-OriginalArrivalTime: 10 Feb 2005 14:22:27.0061 (UTC) FILETIME=[F24F6250:01C50F7B] X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.5 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.5 Bart Schaefer wrote: > } In addition to getkey() and friends, there is the related matter of the > } variable lastchar. Currently this is a single character; I'm not yet > } 100% sure whether we can keep this, or promote it to a wchar_t, or > } whether we might need both types. I fear it may be the last. > > Not just lastchar, but also the KEYS parameter. If wide chars are dealt > with as sequences at the widget binding level, but BUFFER contains the > corresponding wchars instead, then various currently-working tricks that > involve inserting all or part of KEYS into BUFFER will fail. At least, > it becomes harder to emulate self-insert(-multibyte) in widget funcs. I've been looking at all this rather slowly... I think $KEYS is OK. The current intention is for the input to key bindings to remain multibyte strings (metafied where necessary). Modifying BUFFER and other parameters converts from multibyte strings to wide characters automatically; I've already written that bit (because it was easy). So if you feed back KEYS into the system from a function it will pass through the mbtowc stuff at the appropriate level. It does, of course, become trickier to decide how many characters there are in $KEYS --- or, more critically, $BUFFER. However, that's all bound up with how we do ${#KEYS} etc. in the main shell, which is a separate question. I suspect we will want a flag such as ${(m)#KEYS} to treat the string as a multibyte character string instead of raw bytes and maybe a ${(M)#KEYS} not to. The default is tricky; I'm sure you can argue for it to handle multibyte strings by default in a suitable locale, but when Perl did that it broke everything in sight. However, I'm not planning on doing that bit until we've got ZLE out of the way. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. **********************************************************************