From 2a7d3ab36a99c81e9d33bd370cf03a020525f49e Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 28 Oct 2005 18:36:58 +0000 Subject: [PATCH] Fixed bug #416: First/second comb characters not handled in the MARC-8 to UTF-8 conversion. Patch by Raj Patel. --- NEWS | 5 +++-- src/siconv.c | 10 +++++++++- test/tsticonv.c | 10 +++++++++- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index e410645..4cb318b 100644 --- a/NEWS +++ b/NEWS @@ -1,9 +1,10 @@ +Fixed bug #416: First/second comb characters not handled in the +MARC-8 to UTF-8 conversion. Patch by Raj Patel. + Added option -m to GFS to control formatting of timestamps in log file. Added 'exit' as synonym for 'quit' in yaz-client -Possible compatibility problems with earlier versions marked with '*'. - Added support for specifying SRW resultSetId + resultSetIdleTime in a Generic Frontend Server's search handler. Refer to include/yaz/backend.h for the new members. Patch by Ko van der Sloot. diff --git a/src/siconv.c b/src/siconv.c index 378bd75..285d644 100644 --- a/src/siconv.c +++ b/src/siconv.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: siconv.c,v 1.13 2005-06-25 15:46:05 adam Exp $ + * $Id: siconv.c,v 1.14 2005-10-28 18:36:58 adam Exp $ */ /** * \file siconv.c @@ -266,6 +266,14 @@ static unsigned long yaz_read_marc8 (yaz_iconv_t cd, unsigned char *inp, { *no_read = cd->comb_no_read[cd->comb_offset]; x = cd->comb_x[cd->comb_offset]; + + /* special case for double-diacritic combining characters, + INVERTED BREVE and DOUBLE TILDE. + We'll increment the no_read counter by 1, since we want to skip over + the processing of the closing ligature character + */ + if (x == 0x0361 || x == 0x0360) + *no_read += 1; cd->comb_offset++; return x; } diff --git a/test/tsticonv.c b/test/tsticonv.c index c4e75d7..61492b5 100644 --- a/test/tsticonv.c +++ b/test/tsticonv.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: tsticonv.c,v 1.11 2005-08-22 20:34:23 adam Exp $ + * $Id: tsticonv.c,v 1.12 2005-10-28 18:36:59 adam Exp $ */ #if HAVE_CONFIG_H @@ -159,6 +159,14 @@ static void tst_marc8_to_ucs4b() "\xe5\xe8\x41", 12, "\x00\x00\x00\x41" "\x00\x00\x03\x04" "\x00\x00\x03\x08" }, + { /* bug #416 */ + "\xEB\x74\xEC\x73", + 12, "\x00\x00\x00\x74" "\x00\x00\x03\x61" "\x00\x00\x00\x73" + }, + { /* bug #416 */ + "\xFA\x74\xFB\x73", + 12, "\x00\x00\x00\x74" "\x00\x00\x03\x60" "\x00\x00\x00\x73" + }, { 0, 0, 0 } -- 1.7.10.4