[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Is --enable-utf8 working everywhere?

From: Blair Zajac <blair_at_orcaware.com>
Date: 2002-07-17 00:48:12 CEST

Ulrich Drepper wrote:
>
> On Tue, 2002-07-16 at 10:41, Blair Zajac wrote:
>
> > #0 0x000318c4 in apr_xlate_conv_buffer (convset=0x0, inbuf=0xffbef380
> > "stringtest.tmp", inbytes_left=0xffbef0ac, outbuf=0x558f0 "twice as long",
> > outbytes_left=0xffbef0a8) at xlate.c:308
> > 308 if (convset->ich != (iconv_t)-1) {
> > (gdb) bt
> > #0 0x000318c4 in apr_xlate_conv_buffer (convset=0x0, inbuf=0xffbef380
> > "stringtest.tmp", inbytes_left=0xffbef0ac, outbuf=0x558f0 "twice as long",
> > outbytes_left=0xffbef0a8) at xlate.c:308
> > #1 0x0002116c in convert_to_stringbuf (convset=0x0, src_data=0xffbef380
> > "stringtest.tmp", src_length=14, dest=0xffbef134, pool=0x55708)
> > at subversion/libsvn_subr/utf.c:164
> > #2 0x0002161c in svn_utf_cstring_from_utf8 (dest=0xffbef1b4, src=0xffbef380
> > "stringtest.tmp", pool=0x55708) at subversion/libsvn_subr/utf.c:375
>
> I don't have access to the sources so take this with a grain of salt.
>
> It looks as if the function svn_utf_cstring_from_utf8 calls to get a
> iconv descriptor returns NULL as a sign that no such converstion is
> possible. iconv_open normally signals this with (iconv_t)-1. So this
> can be a simple mismatch. The error might not be visible on other
> platforms because they actually do have a decent amount of converters
> available.

[cc'ing dev@apr.apache.org]

It looks like a problem with iconv_open on my Solaris 8 system where
iconv_open returns (iconv_t)-1, but errno is 0.

Here's a way to demonstrate this using Apr only. Apply the following
patch to apr and run

% test/testmd5 626 UTF-8

Amongst the other print out, I get

iconv_open failed: returned ffffffff errno is 0

Best,
Blair

-- 
Blair Zajac <blair@orcaware.com>
Web and OS performance plots - http://www.orcaware.com/orca/
Index: i18n/unix/xlate.c
===================================================================
RCS file: /home/cvspublic/apr/i18n/unix/xlate.c,v
retrieving revision 1.28
diff -u -r1.28 xlate.c
--- i18n/unix/xlate.c   15 Jul 2002 19:21:01 -0000      1.28
+++ i18n/unix/xlate.c   16 Jul 2002 22:46:53 -0000
@@ -52,6 +52,7 @@
  * <http://www.apache.org/>.
  */
+#include <stdio.h>
 #include "apr_private.h"
 #include "apr_lib.h"
@@ -269,7 +270,9 @@
     if (!found) {
         new->ich = iconv_open(topage, frompage);
         if (new->ich == (iconv_t)-1) {
-            return errno;
+const int e = errno;
+fprintf(stderr, "iconv_open failed: returned %p errno is %d\n", new->ich, e);
+            return e;
         }
         found = 1;
         check_sbcs(new);
Index: test/testmd5.c
===================================================================
RCS file: /home/cvspublic/apr/test/testmd5.c,v
retrieving revision 1.14
diff -u -r1.14 testmd5.c
--- test/testmd5.c      10 Jul 2002 06:01:13 -0000      1.14
+++ test/testmd5.c      16 Jul 2002 22:46:53 -0000
@@ -98,6 +98,7 @@
     STD_TEST_NEQ("    apr_md5_init", apr_md5_init(&context))
     if (xlate) {
+#define APR_HAS_XLATE 1
 #if APR_HAS_XLATE
         STD_TEST_NEQ("    apr_md5_set_xlate",
                      apr_md5_set_xlate(&context, xlate))
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jul 17 00:49:06 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.