From: Adam Dickmeiss Date: Fri, 14 Nov 2014 20:34:23 +0000 (+0100) Subject: Fix marc8/utf8 detection in yaz-marcdump X-Git-Tag: v5.6.0~1 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=79e492b21bc47563655bf044a6e5710c06a5fc9d;p=yaz-moved-to-github.git Fix marc8/utf8 detection in yaz-marcdump Also update test_marccol.sh by putting proper leader in resulting MARC record. --- 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);