From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25956 invoked from network); 6 Mar 2008 01:40:03 -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.6 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; 6 Mar 2008 01:40:03 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 74161 invoked from network); 6 Mar 2008 01:39:58 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 Mar 2008 01:39:58 -0000 Received: (qmail 8085 invoked by alias); 6 Mar 2008 01:39:55 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24687 Received: (qmail 8075 invoked from network); 6 Mar 2008 01:39:54 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 6 Mar 2008 01:39:54 -0000 Received: from prunille.vinc17.org (vinc17.pck.nerim.net [213.41.242.187]) by bifrost.dotsrc.org (Postfix) with ESMTP id B2ABE8029404 for ; Thu, 6 Mar 2008 02:39:51 +0100 (CET) Received: by prunille.vinc17.org (Postfix, from userid 501) id 79DD7208D162; Thu, 6 Mar 2008 02:39:50 +0100 (CET) Date: Thu, 6 Mar 2008 02:39:50 +0100 From: Vincent Lefevre To: zsh-workers@sunsite.dk Subject: Re: printf %s in UTF-8 is not POSIX-compliant Message-ID: <20080306013950.GN15833@prunille.vinc17.org> Mail-Followup-To: zsh-workers@sunsite.dk References: <20080304012917.GA15833@prunille.vinc17.org> <200803040940.m249e7DC012517@news01.csr.com> <20080305002721.GF15833@prunille.vinc17.org> <200803051041.m25AfmUc031042@news01.csr.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <200803051041.m25AfmUc031042@news01.csr.com> X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.17-vl-r21552 (2008-03-02) X-Virus-Scanned: ClamAV 0.91.2/6143/Thu Mar 6 01:28:27 2008 on bifrost X-Virus-Status: Clean On 2008-03-05 10:41:48 +0000, Peter Stephenson wrote: > In particular, "emulate sh" is the nearest we have to bash emulation > and bash users are likely to expect multibyte characters to work > naturally. I don't know what you mean by "naturally", but zsh currently behaves differently from bash in sh emulation: vin:~> sh sh-3.1$ printf ".%2s.\n" é .é. sh-3.1$ exit vin:~> zsh -f vin% emulate sh vin% printf ".%2s.\n" é . é. vin% And the behavior of bash, when run as sh, will not change. So, I expect zsh to do the same in sh emulation mode. Note that bash still outputs .é. (POSIX behavior) when run as bash, but this may change. > Is it time to introduce a separate "bash" emulation (meaning smart, > interactive shell not necessarily 100% POSIX compatible) and > document that "sh" emulation is aimed at POSIX compatibility? > "emulate bash" already works but is treated the same way as "emulate sh". Perhaps it should have the same differences as bash with and without POSIX mode. I don't know what the best behavior is about the startup files. From the bash man page: [...] When invoked as sh, bash enters posix mode after the startup files are read. When bash is started in posix mode, as with the --posix command line option, it follows the POSIX standard for startup files. [...] -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)