From 6d59a642cb7cd71df249fc4ecf5928ea79c7038c Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 27 Sep 2013 15:12:33 +0200 Subject: [PATCH] Improve display of MARC records with multi-byte subfield IDs YAZ-695 In some rare cases subfield identifiers are multi-byte characters. This will try to deterime length of those and split accordingly. This affects display in line mode as MARCXML/MarcXchange. The encoding of ISO2709 is the same. --- src/marcdisp.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/marcdisp.c b/src/marcdisp.c index 12ecb38..ad9eed6 100644 --- a/src/marcdisp.c +++ b/src/marcdisp.c @@ -464,6 +464,15 @@ static size_t cdata_one_character(yaz_marc_t mt, const char *buf) } return 1; /* giving up */ } + else + { + int error = 0; + size_t no_read = 0; + (void) yaz_read_UTF8_char((const unsigned char *) buf, strlen(buf), + &no_read, &error); + if (error == 0 && no_read > 0) + return no_read; + } return 1; /* we don't know */ } -- 1.7.10.4