Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 7605 invoked by uid 500); 23 Jul 2002 15:14:52 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 7467 invoked from network); 23 Jul 2002 15:14:51 -0000 To: Jeff Trawick Cc: dev@apr.apache.org, dev@subversion.tigris.org Subject: Re: status (?) of current iconv breakage References: Reply-To: kfogel@collab.net Microsoft: where even the version numbers aren't Y2K-compliant From: Karl Fogel Date: 23 Jul 2002 09:47:33 -0500 In-Reply-To: Message-ID: <8565z6wlfe.fsf@newton.ch.collab.net> Lines: 140 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.50 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Jeff Trawick writes: > Is anybody working on any of this? Am I confused about something? >=20 > 1) APRUTIL_EXPORT_LIBS not used in Apache, so httpd won't load on some > platforms >=20 > 2) apr_iconv_inbuf_const hints from apr_hints.m4 not migrated (to > where?) >=20 > 3) APU_CHECK_ICONV_INBUF not working >=20 > config.log shows that a warning is generated from the test compile > but it does not set apu_iconv_inbuf_const on my RH-6.2/glibc-2.1.3 > box >=20 > This seems to be because $GCC is not set in the apr-util so the > APR_TRY_COMPILE_NO_WARNING can't work when using gcc. >=20 > Does anyone know of other breakage? Recently on the Subversion list, Mike Pilato asked Branko =C4=8Cibej for a summary what he knows about the current state of iconv breakage. Here is Brane's response: From: Branko =C4=8Cibej Subject: Re: Alpha on Win32 without UTF8 conversion To: cmpilato@collab.net CC: dev@subversion.tigris.org Date: Tue, 23 Jul 2002 04:12:50 +0200 =20=20=20 cmpilato@collab.net wrote: =20=20=20 >Brane, if you can (pleeeeease) take the time to summarize briefly the >problems you know of, and a checklist of whether or not you've got >solutions for those problems (perhaps pending in mailing list >archives), I'd be glad to take a stab at picking up where you left >off. > =20=20=20 O.K., here's a summary: =20=20=20 * Paths in APR: o We must have a way to find out what encoding the file names produced and consumed by APR have, because on WinNT, those will always be in UTF-8, regardless of the current locale settings. See my message and resulting thread in dev@apr: =20=20=20 Subject: [PATCH] Determining the character encoding used for paths in APR =20=20=20 * Determining the default locale encoding: o apr_xlate.h defines APR_LOCALE_CHARSET, which you can pass to apr_xlate_open to have it figure out the encoding used by the current locale. The implementation is unix-only. I wrote a patch for Windows; I'm attaching the relevant bits of that patch. o Now that apr_xlate is in apr-util, that patch has to be broken out and the code moved into APR. I suggested two new functions, apr_os_locale_encoding and apr_os_default_encoding, that would replace the get_locale_charset and get_default_charset in xlate.c. * Getting a working iconv library o apr-iconv isn't. o I still think supporting GNU libiconv is the way to go. See my mail in dev@subversion: =20=20=20 Subject: Re: Is --enable-utf8 working everywhere? Message-ID: <3D34CD49.2070403@xbc.nu> Either the solition that detects and builds the libiconv sources, or one that detects and links with a pre-compiled libiconv, would be fine. Note that we wouldn't distribute any LGPL code, nor make libiconv binaries available -- just tell users how to build them. For the win32 binaries on the sownload site, it'd be quite enought to add a link to the gnu site where the sources are available; it's not as if we're changing that source. =20=20=20 =20=20=20 Please ask if any of this isn't clear. =20=20=20 --=20 Brane =C4=8Cibej http://www.xbc.nu/brane/ Index: i18n/unix/xlate.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/apr/i18n/unix/xlate.c,v retrieving revision 1.28 diff -u -p -r1.28 xlate.c --- i18n/unix/xlate.c 15 Jul 2002 19:21:01 -0000 1.28 +++ i18n/unix/xlate.c 17 Jul 2002 00:46:12 -0000 @@ -146,9 +146,21 @@ static const char *get_default_charset(v * defer to get_default_charset(). */ =20=20=20=20 -static const char *get_locale_charset(void) +static const char *get_locale_charset(apr_pool_t *pool) { -#if defined(HAVE_NL_LANGINFO) && defined(HAVE_CODESET) +#ifdef WIN32 + /* ### Yes, this is a hack and doesn't belong in this file. + Will fix soonest. --brane */ + LCID locale =3D GetThreadLocale(); + int len =3D GetLocaleInfo(locale, LOCALE_IDEFAULTANSICODEPAGE, NULL= , 0); + char *cp =3D apr_palloc(pool, len + 2); + if (0 < GetLocaleInfo(locale, LOCALE_IDEFAULTANSICODEPAGE, cp + 2, = len)) + { + cp[0] =3D 'C'; + cp[1] =3D 'P'; + return cp; + } +#elif defined(HAVE_NL_LANGINFO) && defined(HAVE_CODESET) const char *charset; charset =3D nl_langinfo(CODESET); if (charset) { @@ -158,13 +170,13 @@ static const char *get_locale_charset(vo return get_default_charset(); } =20=20=20=20 -static const char *handle_special_names(const char *page) +static const char *handle_special_names(const char *page, apr_pool_t *p= ool) { if (page =3D=3D APR_DEFAULT_CHARSET) { return get_default_charset(); } else if (page =3D=3D APR_LOCALE_CHARSET) { - return get_locale_charset(); + return get_locale_charset(pool); } else { return page; @@ -236,8 +250,8 @@ apr_status_t apr_xlate_open(apr_xlate_t=20 =20=20=20=20 *convset =3D NULL; =20=20=20=20 - topage =3D handle_special_names(topage); - frompage =3D handle_special_names(frompage); + topage =3D handle_special_names(topage, pool); + frompage =3D handle_special_names(frompage, pool); =20=20=20=20=20=20=20=20 new =3D (apr_xlate_t *)apr_pcalloc(pool, sizeof(apr_xlate_t)); if (!new) {