From: Marc Cromme Date: Thu, 12 Apr 2007 10:17:53 +0000 (+0000) Subject: removed break statement - actually _using_ the specified target X-Git-Tag: PAZPAR2.1.0.0~316 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=e747ba663e751cd4cd2b1dd9547bc5a64f5eac2b;p=pazpar2-moved-to-github.git removed break statement - actually _using_ the specified target encoding to initiate an yaz_iconv_t object, now yaz_marc_iconv(db->yaz_marc, cm) converts to UTF-8 marc records, and XML conversion is fine --- diff --git a/src/database.c b/src/database.c index f3225ee..0f18865 100644 --- a/src/database.c +++ b/src/database.c @@ -1,4 +1,4 @@ -/* $Id: database.c,v 1.16 2007-04-12 07:15:48 marc Exp $ +/* $Id: database.c,v 1.17 2007-04-12 10:17:53 marc Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -327,19 +327,20 @@ static void prepare_yazmarc(void *ignore, struct database *db) db->yaz_marc = yaz_marc_create(); yaz_marc_subfield_str(db->yaz_marc, "\t"); + // See if a native encoding is specified if ((s = db->settings[PZ_ENCODING])) - { encoding = s->value; - break; - } - if (!(cm = yaz_iconv_open("utf-8", encoding))) + + cm = yaz_iconv_open("utf-8", encoding); + if (!cm) { - yaz_log(YLOG_FATAL, "Unable to map from %s to UTF-8", encoding); + yaz_log(YLOG_FATAL, + "Unable to map from %s to UTF-8 for target %s", + encoding, db->url); exit(1); } yaz_marc_iconv(db->yaz_marc, cm); - break; } }