Fix marc8/utf8 detection in yaz-marcdump
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 14 Nov 2014 20:34:23 +0000 (21:34 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 14 Nov 2014 20:34:23 +0000 (21:34 +0100)
Also update test_marccol.sh by putting proper leader in resulting
MARC record.

test/test_marccol.sh
util/marcdump.c

index 63031b7..b3cb24c 100755 (executable)
@@ -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
index c45d146..940ed4d 100644 (file)
@@ -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);