Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 287 invoked from network); 5 Jun 2006 23:25:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Jun 2006 23:25:52 -0000 Received: (qmail 97151 invoked by uid 500); 5 Jun 2006 23:25:50 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 97101 invoked by uid 500); 5 Jun 2006 23:25:50 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 97090 invoked by uid 99); 5 Jun 2006 23:25:50 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jun 2006 16:25:50 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [67.95.107.114] (HELO mail1.thewrittenword.com) (67.95.107.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jun 2006 16:25:48 -0700 Received: by mail1.thewrittenword.com (Postfix, from userid 1000) id 0723D2D0; Mon, 5 Jun 2006 18:25:24 -0500 (CDT) Date: Mon, 5 Jun 2006 18:25:24 -0500 From: Albert Chin To: dev@apr.apache.org Subject: apr_xlate_open() problem on Solaris 8/SPARC Message-ID: <20060605232523.GD15447@mail1.thewrittenword.com> Reply-To: dev@apr.apache.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I've built apr-0.9.11 and apr-util-0.9.11 on Solaris 8/SPARC with the Sun C compiler. I'm using GNU libiconv() so APU_HAVE_ICONV is defined. $ cat a.c #include #include #include #include int main (void) { apr_pool_t *pool; apr_xlate_t *handle; apr_status_t apr_err; apr_initialize (); apr_pool_create (&pool, NULL); apr_err = apr_xlate_open (&handle, APR_LOCALE_CHARSET, "UTF-8", pool); if (APR_STATUS_IS_EINVAL (apr_err) || APR_STATUS_IS_ENOTIMPL (apr_err)) handle = NULL; else if (apr_err != APR_SUCCESS) exit (1); } $ cc -g a.c -laprutil -lapr $ ./a.out $ echo $? 1 I dug into apr_xlate_open() and, when APR_LOCALE_CHARSET is passed, frompage == apr_os_locale_encoding(). From apr-0.9.11/misc/unix/charset.c, apr_os_locale_encoding() will use the charset returned by nl_langinfo(CODESET). On Solaris it is "646". So, we want a conversion from "646" to "UTF-8". However, iconv_open() errors out in this case. Trying the native Solaris iconv_open() for a conversion from "646" to "UTF-8" seems to work though. Is this the recommended iconv implementation for this platform? Should I be using apr-iconv instead of GNU libiconv? include/apu.h.in seems to have: #define APU_HAVE_APR_ICONV 0 -- albert chin (china@thewrittenword.com)