From e747ba663e751cd4cd2b1dd9547bc5a64f5eac2b Mon Sep 17 00:00:00 2001 From: Marc Cromme Date: Thu, 12 Apr 2007 10:17:53 +0000 Subject: [PATCH] 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 --- src/database.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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; } } -- 1.7.10.4