X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fsiconv.c;h=9e59038cf18a14c99e2e0d69da5294376c44f9c0;hb=019eca69c2a438db0aea7b8760685c618cb5f552;hp=0f8f99d13e54d4e8f5bbba894463b302cb66889c;hpb=afae1117609712743c1109597d080a53a8dac5d4;p=yaz-moved-to-github.git diff --git a/src/siconv.c b/src/siconv.c index 0f8f99d..9e59038 100644 --- a/src/siconv.c +++ b/src/siconv.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: siconv.c,v 1.43 2007-09-17 19:18:27 adam Exp $ + * $Id: siconv.c,v 1.46 2007-10-05 15:11:36 adam Exp $ */ /** * \file siconv.c @@ -1182,6 +1182,11 @@ static unsigned long yaz_read_marc8_comb(yaz_iconv_t cd, unsigned char *inp, } if (inbytesleft <= 0) return 0; + else if (*inp == ' ') + { + *no_read += 1; + return ' '; + } else { unsigned long x; @@ -1447,7 +1452,7 @@ static unsigned long lookup_marc8(yaz_iconv_t cd, *utf8_outbuf = '\0'; inp = (unsigned char *) utf8_buf; inbytesleft = strlen(utf8_buf); - + x = yaz_marc8r_42_conv(inp, inbytesleft, &no_read_sub, comb); if (x) { @@ -1643,9 +1648,12 @@ static size_t yaz_write_marc8_2(yaz_iconv_t cd, unsigned long x, if (r) return r; - r = yaz_write_marc8_page_chr(cd, outbuf, outbytesleft, page_chr); - if (r) - return r; + if (page_chr) + { + r = yaz_write_marc8_page_chr(cd, outbuf, outbytesleft, page_chr); + if (r) + return r; + } cd->write_marc8_last = y; } return 0;