MARC-8: allow all characters 0x01-0x20 YAZ-650
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 10 Apr 2013 09:07:58 +0000 (11:07 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 10 Apr 2013 09:07:58 +0000 (11:07 +0200)
src/iconv_decode_marc8.c
src/iconv_encode_marc8.c

index 72970b3..86f1246 100644 (file)
@@ -172,10 +172,10 @@ static unsigned long yaz_read_marc8_comb(yaz_iconv_t cd,
     }
     if (inbytesleft == 0)
         return 0;
-    else if (*inp == ' ')
+    else if (*inp <= ' ')
     {
         *no_read += 1;
-        return ' ';
+        return *inp;
     }
     else
     {
index e8434ff..cfdd1be 100644 (file)
@@ -72,6 +72,11 @@ static unsigned long lookup_marc8(yaz_iconv_t cd,
     size_t utf8_outbytesleft = sizeof(utf8_buf)-1, r;
     int error_code;
 
+    if (x <= ' ')
+    {
+        *page_chr = ESC "(B";
+        return x;
+    }
     r = yaz_write_UTF8_char(x, &utf8_outbuf, &utf8_outbytesleft, &error_code);
     if (r == (size_t)(-1))
     {