From 1346b30779b120691e4145a3578716f77300951e Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 10 Apr 2013 11:07:58 +0200 Subject: [PATCH] MARC-8: allow all characters 0x01-0x20 YAZ-650 --- src/iconv_decode_marc8.c | 4 ++-- src/iconv_encode_marc8.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) 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)) { -- 1.7.10.4