From: Adam Dickmeiss Date: Fri, 27 Sep 2013 13:12:33 +0000 (+0200) Subject: Improve display of MARC records with multi-byte subfield IDs YAZ-695 X-Git-Tag: v4.2.69~4 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=6d59a642cb7cd71df249fc4ecf5928ea79c7038c;p=yaz-moved-to-github.git 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. --- 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 */ }