From: Adam Dickmeiss Date: Wed, 10 Apr 2013 09:07:58 +0000 (+0200) Subject: MARC-8: allow all characters 0x01-0x20 YAZ-650 X-Git-Tag: v4.2.53~4 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=1346b30779b120691e4145a3578716f77300951e MARC-8: allow all characters 0x01-0x20 YAZ-650 --- diff --git a/src/iconv_decode_marc8.c b/src/iconv_decode_marc8.c index 72970b3..86f1246 100644 --- a/src/iconv_decode_marc8.c +++ b/src/iconv_decode_marc8.c @@ -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 { diff --git a/src/iconv_encode_marc8.c b/src/iconv_encode_marc8.c index e8434ff..cfdd1be 100644 --- a/src/iconv_encode_marc8.c +++ b/src/iconv_encode_marc8.c @@ -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)) {