From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14503 invoked from network); 26 Feb 2008 16:14:10 -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; 26 Feb 2008 16:14:10 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 87511 invoked from network); 26 Feb 2008 16:14:01 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Feb 2008 16:14:01 -0000 Received: (qmail 14852 invoked by alias); 26 Feb 2008 16:13:57 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24596 Received: (qmail 14837 invoked from network); 26 Feb 2008 16:13:56 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 26 Feb 2008 16:13:56 -0000 Received: from cluster-g.mailcontrol.com (cluster-g.mailcontrol.com [85.115.41.190]) by bifrost.dotsrc.org (Postfix) with ESMTP id D89768026E0B for ; Tue, 26 Feb 2008 17:13:51 +0100 (CET) Received: from rly12g.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly12g.srv.mailcontrol.com (MailControl) with ESMTP id m1QGDPik031614 for ; Tue, 26 Feb 2008 16:13:42 GMT Received: from submission.mailcontrol.com (submission.mailcontrol.com [86.111.216.190]) by rly12g.srv.mailcontrol.com (MailControl) id m1QGCHkI028148 for zsh-workers@sunsite.dk; Tue, 26 Feb 2008 16:12:17 GMT Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly12g-eth0.srv.mailcontrol.com (envelope-sender Peter.Stephenson@csr.com) (MIMEDefang) with ESMTP id m1QGB9lE022478; Tue, 26 Feb 2008 16:12:17 +0000 (GMT) Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Tue, 26 Feb 2008 16:10:58 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.2/8.13.4) with ESMTP id m1QGAwPc008942; Tue, 26 Feb 2008 16:10:58 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.14.2/8.14.2/Submit) with ESMTP id m1QGAwJ3008939; Tue, 26 Feb 2008 16:10:58 GMT Message-Id: <200802261610.m1QGAwJ3008939@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: Dagobert Michelsen cc: zsh-workers@sunsite.dk Subject: Re: * Re: Failed tests of zsh 4.3.5 in Solaris 10 w/Sun Studio 12 CC In-reply-to: <656429B3-438B-4ECF-85C4-04E38D837D1A@blastwave.org> References: <8AABEECB-A9A6-43EA-BED2-4BE376CBE349@blastwave.org> <20080226141459.76dc362c@news01> <20080226145741.6e74fc22@news01> <656429B3-438B-4ECF-85C4-04E38D837D1A@blastwave.org> Comments: In-reply-to Dagobert Michelsen message dated "Tue, 26 Feb 2008 16:18:10 +0100." Date: Tue, 26 Feb 2008 16:10:58 +0000 From: Peter Stephenson X-OriginalArrivalTime: 26 Feb 2008 16:10:58.0897 (UTC) FILETIME=[2C9AF410:01C87892] X-Scanned-By: MailControl A-08-00-04 (www.mailcontrol.com) on 10.71.1.122 X-Virus-Scanned: ClamAV 0.91.2/6003/Tue Feb 26 12:34:31 2008 on bifrost X-Virus-Status: Clean Dagobert Michelsen wrote: > 16896: -> libiconv:libiconv_open(0xdf986e04, 0x80c1e90) > > ...and... > > thor% mdb -p 16896 > Loading modules: [ ] > > 0xdf986e04/S > 0xdf986e04: 646 > > 0x80c1e90/S > 0x80c1e90: UCS-4BE > > Looks like there is no 646: > > thor% /opt/csw/bin/iconv -l | grep 646 > ANSI_X3.4-1968 ANSI_X3.4-1986 ASCII CP367 IBM367 ISO-IR-6 ISO646-US > ISO_646.IRV:1991 US US-ASCII CSASCII > ISO-10646-UCS-2 UCS-2 CSUNICODE > ISO-10646-UCS-4 UCS-4 CSUCS4 > ISO-IR-14 ISO646-JP JIS_C6220-1969-RO JP CSISO14JISC6220RO > CN GB_1988-80 ISO-IR-57 ISO646-CN CSISO57GB1988 > > Is this an error from zsh or is this a bug in libiconv? The first argument comes directly from what nl_langinfo(CODESET) is returning. I've tried it on our rather old Solaris 8 system and I get the same as you, 646---and my iconv doesn't handle that either. I asked the nice man from Mountain View about "nl_langinfo CODESET 646" and it seems Solaris just sort of does that if doesn't think much of the current codeset (e.g. not installed). So I think we just need to massage it to some reasonable default, which probably means "US-ASCII" (I'm not sure why that's better than "ASCII", which I thought was unique, but that's what people seem to use---POSIX rather self-centredly suggests "POSIX" but iconv doesn't seem to support that). I don't think 646 means anything, so I haven't made this dependent on system. Assuming ASCII shouldn't be a problem: if the 7-bit subset isn't ASCII the shell is likely to have disappeared in a puff of smoke by now. I suppose trapping "" is a good thing, too, since iconv_open() doesn't appear to have useful defaults (and there's no reason why it should have). As they say in US police dramas, "I'm denying your 646". Or something. Index: Src/utils.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/utils.c,v retrieving revision 1.177 diff -u -r1.177 utils.c --- Src/utils.c 26 Feb 2008 14:50:05 -0000 1.177 +++ Src/utils.c 26 Feb 2008 16:02:07 -0000 @@ -4867,6 +4867,7 @@ } else { # ifdef HAVE_ICONV ICONV_CONST char *inptr = inbuf; + const char *codesetstr = nl_langinfo(CODESET); inbytes = 4; outbytes = 6; /* store value in big endian form */ @@ -4875,6 +4876,18 @@ wval >>= 8; } + /* + * If the code set isn't handled, we'd better + * assume it's US-ASCII rather than just failing + * hopelessly. Solaris has a weird habit of + * returning 646. + * + * It shouldn't ever be NULL, but while we're + * being paranoid... + */ + if (!codessetstr || !*codsetstr || + !strcmp(codesetstr, "646")) + codesetstr == "US-ASCII"; cd = iconv_open(nl_langinfo(CODESET), "UCS-4BE"); if (cd == (iconv_t)-1) { zerr("cannot do charset conversion (iconv failed)"); -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070