From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16966 invoked by alias); 15 Feb 2012 02:24:00 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30220 Received: (qmail 4606 invoked from network); 15 Feb 2012 02:23:57 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at vinc17.net does not designate permitted sender hosts) Date: Wed, 15 Feb 2012 03:15:19 +0100 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: printf %s in UTF-8 is not always POSIX-compliant Message-ID: <20120215021519.GA19525@xvii.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Mailer-Info: http://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.21-6201-vl-r48020 (2011-12-20) Hi, I've reported the following bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=659932 In UTF-8 locales: xvii% printf ".%2s.\n" é . é. xvii% emulate sh xvii% printf ".%2s.\n" é .é. xvii% emulate ksh xvii% printf ".%2s.\n" é . é. It is correct in sh mode (according to POSIX[*]), but not in ksh mode, which should also follow the POSIX behavior. What about zsh mode? [*] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html and http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap05.html#tag_05 for %s. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)