From: Adam Dickmeiss Date: Fri, 25 May 2007 14:05:52 +0000 (+0000) Subject: Flush the iconv sequence for each sequence in a .chr file. This fixes X-Git-Tag: ZEBRA.2.0.16~33 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=bade734afdf52709b5c01052bab003dc968d079c;p=idzebra-moved-to-github.git Flush the iconv sequence for each sequence in a .chr file. This fixes nothing because the ICONV handles in use always flushed themselves. They may not always do that, so we must do it. --- diff --git a/util/charmap.c b/util/charmap.c index 85c9239..2ca7af1 100644 --- a/util/charmap.c +++ b/util/charmap.c @@ -1,4 +1,4 @@ -/* $Id: charmap.c,v 1.45 2007-05-25 13:46:01 adam Exp $ +/* $Id: charmap.c,v 1.46 2007-05-25 14:05:52 adam Exp $ Copyright (C) 1995-2007 Index Data ApS @@ -420,6 +420,10 @@ static int scan_to_utf8(yaz_iconv_t t, ucs4_t *from, size_t inlen, else { ret = yaz_iconv(t, &inbuf, &inbytesleft, &outbuf, &outbytesleft); + if (ret != (size_t) (-1)) + ret = yaz_iconv(t, 0, 0, &outbuf, &outbytesleft); + + if (ret == (size_t) (-1)) { yaz_log(YLOG_LOG, "from: %2X %2X %2X %2X", @@ -454,6 +458,9 @@ static int scan_string(char *s_native, size_t ret; ret = yaz_iconv(t_unicode, &inbuf, &inbytesleft, &outbuf, &outbytesleft); + if (ret != (size_t)(-1)) + ret = yaz_iconv(t_unicode, 0, 0, &outbuf, &outbytesleft); + if (ret == (size_t)(-1)) return -1; i = (outbuf - (char*) arg)/sizeof(ucs4_t);