From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7153 invoked from network); 6 Jan 2006 22:40:38 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 6 Jan 2006 22:40:38 -0000 Received: (qmail 11052 invoked from network); 6 Jan 2006 22:40:32 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 Jan 2006 22:40:32 -0000 Received: (qmail 798 invoked by alias); 6 Jan 2006 22:40:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22129 Received: (qmail 777 invoked from network); 6 Jan 2006 22:40:29 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 6 Jan 2006 22:40:29 -0000 Received: (qmail 10668 invoked from network); 6 Jan 2006 22:40:29 -0000 Received: from mta08-winn.ispmail.ntl.com (81.103.221.48) by a.mx.sunsite.dk with SMTP; 6 Jan 2006 22:40:28 -0000 Received: from aamta11-winn.ispmail.ntl.com ([81.103.221.35]) by mta08-winn.ispmail.ntl.com with ESMTP id <20060106224027.KDRT17804.mta08-winn.ispmail.ntl.com@aamta11-winn.ispmail.ntl.com> for ; Fri, 6 Jan 2006 22:40:27 +0000 Received: from pwslaptop.csr.com ([81.105.238.64]) by aamta11-winn.ispmail.ntl.com with SMTP id <20060106224026.CQIC19063.aamta11-winn.ispmail.ntl.com@pwslaptop.csr.com> for ; Fri, 6 Jan 2006 22:40:26 +0000 Date: Fri, 6 Jan 2006 22:40:19 +0000 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: bug in completion/expansion of files with LANG=C Message-Id: <20060106224019.38347e0e.p.w.stephenson@ntlworld.com> In-Reply-To: <20060106215829.GG10111@dot.blorf.net> References: <20060106215829.GG10111@dot.blorf.net> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 6 Jan 2006 13:58:29 -0800 Wayne Davison wrote: > What should zsh do with characters that are outside the current > character set? Display them as \M-* values? A zsh without multibyte > support displays the name as hmm-\M-C\M-$ when being listed by the > completion system, but inserts the name into the command-line as literal > characters. Perhaps a multibyte-enabled zsh should edit these illegal > characters on the command-line as 4-byte-wide \M-* values; and go back > to displaying them in completion lists that way too? There are two difficulties that I can see at the moment. First, and more fundamentally, we don't have any way of representing invalid characters now that zle uses wchar_t internally (and that's not going to change since it works very well). If we can't convert a multibyte character to a wchar_t we therefore can't do anything with it. We would need to add a flag for each character position to indicate that it contained, say, a byte-wide chunk of a character that we couldn't convert. That's a little hairy and messes up any attempt to convert a complete wide string in one go. Alternatively, we could convert the characters to a \M- or other representation on input, but it doesn't help much since we still need somehow to mark that a group of characters needs converting back to a byte on output. The big difference from the old single-byte code is that in that case we knew that every byte could be treated in that fashion. It's mixing the two that's the difficulty. Second, and less difficult, it's quite a big change to have characters in the command line displayed differently from the way they naturally output. No doubt it could be done, perhaps by an extra stage of mapping in zrefresh(). It would be quite helpful to have them with some terminal effect, too. Once that were done, it wouldn't be too hard to have different sorts of mapping, so you could pick between a \M- representation and a hex code. -- Peter Stephenson Web page still at http://www.pwstephenson.fsnet.co.uk/