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
-/* $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.
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
db->yaz_marc = yaz_marc_create();
yaz_marc_subfield_str(db->yaz_marc, "\t");
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]))
// See if a native encoding is specified
if ((s = db->settings[PZ_ENCODING]))
- 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);
exit(1);
}
yaz_marc_iconv(db->yaz_marc, cm);