From 79e492b21bc47563655bf044a6e5710c06a5fc9d Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 14 Nov 2014 21:34:23 +0100 Subject: [PATCH] Fix marc8/utf8 detection in yaz-marcdump Also update test_marccol.sh by putting proper leader in resulting MARC record. --- test/test_marccol.sh | 4 ++-- util/marcdump.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_marccol.sh b/test/test_marccol.sh index 63031b7..b3cb24c 100755 --- a/test/test_marccol.sh +++ b/test/test_marccol.sh @@ -31,12 +31,12 @@ for f in ${srcdir}/marccol?.u8.marc; do fi filem=`echo $fb | sed 's/u8/m8/'`.marc - ../util/yaz-marcdump -o marc -f utf8 -t marc8lossless $f >$filem + ../util/yaz-marcdump -l 9=32 -o marc -f utf8 -t marc8lossless $f >$filem DIFF=${fb}.2.lst.diff NEW=${fb}.2.lst.new OLD=${srcdir}/${fb}.2.lst - ../util/yaz-marcdump -f marc8 -t utf-8 $filem >$NEW + ../util/yaz-marcdump -l 9=97 -f marc8 -t utf-8 $filem >$NEW if test $? != "0"; then echo "$f: yaz-marcdump returned error" ecode=1 diff --git a/util/marcdump.c b/util/marcdump.c index c45d146..940ed4d 100644 --- a/util/marcdump.c +++ b/util/marcdump.c @@ -434,7 +434,7 @@ static void dump(const char *fname, const char *from, const char *to, { cd1 = yaz_iconv_open(to, "utf-8"); if (cd1) - yaz_marc_iconv(mt, cd); + yaz_marc_iconv(mt, cd1); } r = yaz_marc_decode_buf(mt, buf, -1, &result, &len_result); -- 1.7.10.4