-/* $Id: d1_read.c,v 1.23 2007-03-19 21:50:39 adam Exp $
+/* $Id: d1_read.c,v 1.24 2007-03-20 22:07:35 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
{
char *outbuf = wrbuf->buf + wrbuf->pos;
size_t outlen = wrbuf->size - wrbuf->pos;
- if (yaz_iconv (t, &inbuf, &inlen, &outbuf, &outlen) ==
+ if (yaz_iconv(t, &inbuf, &inlen, &outbuf, &outlen) ==
(size_t)(-1) && yaz_iconv_error(t) != YAZ_ICONV_E2BIG)
{
/* bad data. stop and skip conversion entirely */
return -1;
}
else if (inlen == 0)
- { /* finished converting */
+ { /* finished converting, flush it */
+ yaz_iconv(t, 0, 0, &outbuf, &outlen);
wrbuf->pos = wrbuf->size - outlen;
break;
}
-/* $Id: untrans.c,v 1.2 2007-01-15 15:10:17 adam Exp $
+/* $Id: untrans.c,v 1.3 2007-03-20 22:07:35 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
if (ret == (size_t)(-1))
len = 0;
else
+ {
+ yaz_iconv (zh->iconv_from_utf8, 0, 0, &outbuf, &outleft);
len = outbuf - term_dst;
+ }
*dst = nmem_malloc(stream, len + 1);
if (len > 0)
memcpy (*dst, term_dst, len);
-/* $Id: zaptterm.c,v 1.2 2007-01-15 15:10:17 adam Exp $
+/* $Id: zaptterm.c,v 1.3 2007-03-20 22:07:35 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
0);
return ZEBRA_FAIL;
}
+ yaz_iconv(zh->iconv_to_utf8, 0, 0, &outbuf, &outleft);
*outbuf = 0;
}
else
-/* $Id: zsets.c,v 1.119 2007-01-17 15:35:48 adam Exp $
+/* $Id: zsets.c,v 1.120 2007-03-20 22:07:35 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
if (ret == (size_t)(-1))
*termlen = 0;
else
+ {
+ yaz_iconv(zh->iconv_from_utf8, 0, 0,
+ &outbuf, &outleft);
*termlen = outbuf - termbuf;
+ }
}
else
{