X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fopac_to_xml.c;h=f365082167efa73c73c8058ce100c0b572b100f9;hp=2e37091ee06075dd9eb0d45a132a12cfec065fbe;hb=6533da485c4fcf4bc1bb6d70d0b18b13602381ff;hpb=d0ef47f9201e7316a04f8b1c9d8e7799d9eb8d8a diff --git a/src/opac_to_xml.c b/src/opac_to_xml.c index 2e37091..f365082 100644 --- a/src/opac_to_xml.c +++ b/src/opac_to_xml.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2013 Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ /** @@ -31,10 +31,11 @@ static void opac_element_str(WRBUF wrbuf, yaz_iconv_t cd1, yaz_iconv_t cd2, wrbuf_puts(wrbuf, ">"); pos = wrbuf->pos; /* save position */ - if (wrbuf_iconv_write_x(wrbuf, cd1, data, strlen(data), 1) && cd2) + if (wrbuf_iconv_write2(wrbuf, cd1, data, strlen(data), wrbuf_xmlputs_n) + && cd2) { wrbuf->pos = pos; /* rewind to pos */ - wrbuf_iconv_write_x(wrbuf, cd2, data, strlen(data), 1); + wrbuf_iconv_write2(wrbuf, cd2, data, strlen(data), wrbuf_xmlputs_n); } wrbuf_puts(wrbuf, "bibliographicRecord) + { + Z_External *ext = r->bibliographicRecord; + if (ext->which == Z_External_octet) + { + return yaz_marc_check_marc21_coding( + charset, + (const char *) ext->u.octet_aligned->buf, + ext->u.octet_aligned->len); + } + } + return 0; +} + /* * Local variables: * c-basic-offset: 4