From 99eee17dbb3ef0d81d44b01d9072e3405f326595 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Mon, 17 Nov 2008 16:13:53 +0100 Subject: [PATCH] still learning using GIT, some changes were not committed: fake support for decoding ISO5426 -> utf8 --- src/Makefile.am | 8 ++++++-- src/iconv-p.h | 2 +- src/siconv.c | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 1e79c0e..412a9ae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -42,6 +42,10 @@ marc8.c: charconv.tcl codetables.xml marc8r.c: charconv.tcl codetables.xml $(TCLSH) $(srcdir)/charconv.tcl -r -p marc8r $(srcdir)/codetables.xml -o marc8r.c +# ISO5426->UTF8 conversion is generated from codetables.xml +iso5426.c: charconv.tcl codetables-iso5426.xml + $(TCLSH) $(srcdir)/charconv.tcl -p iso5426 $(srcdir)/codetables-iso5426.xml -o iso5426.c + # Generate OID database from CSV oid_std.c $(top_srcdir)/include/yaz/oid_std.h: oidtoc.tcl oid.csv $(TCLSH) $(srcdir)/oidtoc.tcl $(srcdir) $(srcdir)/oid.csv oid_std.c oid_std.h @@ -58,7 +62,7 @@ diagsru_update.c $(top_srcdir)/include/yaz/diagsru_update.h: csvtosru_update.tcl # Auto-generated C-files GEN_FILES = oid_std.c \ - marc8.c marc8r.c \ + marc8.c marc8r.c iso5426.c \ diagbib1.c diagsrw.c diagsru_update.c \ z-accdes1.c z-accform1.c z-acckrb1.c z-core.c \ z-diag1.c z-espec1.c z-estask.c z-exp.c z-grs.c z-mterm2.c z-opac.c \ @@ -98,7 +102,7 @@ libyaz_la_SOURCES=version.c options.c log.c \ record_conv.c retrieval.c elementset.c snprintf.c query-charset.c \ copy_types.c match_glob.c poll.c daemon.c \ iconv_encode_marc8.c iconv_encode_iso_8859_1.c iconv_encode_wchar.c \ - iconv_decode_marc8.c sc.c + iconv_decode_marc8.c iconv_decode_iso5426.c sc.c libyaz_la_LDFLAGS=-version-info $(YAZ_VERSION_INFO) diff --git a/src/iconv-p.h b/src/iconv-p.h index 499842f..f99943b 100644 --- a/src/iconv-p.h +++ b/src/iconv-p.h @@ -89,7 +89,7 @@ struct yaz_iconv_decoder_s { yaz_iconv_decoder_t yaz_marc8_decoder(const char *fromcode, yaz_iconv_decoder_t d); -yaz_iconv_decoder_t yaz_iso5426_decode(const char *fromcode, +yaz_iconv_decoder_t yaz_iso5426_decoder(const char *fromcode, yaz_iconv_decoder_t d); yaz_iconv_decoder_t yaz_utf8_decoder(const char *fromcode, yaz_iconv_decoder_t d); diff --git a/src/siconv.c b/src/siconv.c index 36dc4b2..d7f066d 100644 --- a/src/siconv.c +++ b/src/siconv.c @@ -78,6 +78,8 @@ static int prepare_decoders(yaz_iconv_t cd, const char *tocode) { if (yaz_marc8_decoder(tocode, &cd->decoder)) return 1; + if (yaz_iso5426_decoder(tocode, &cd->decoder)) + return 1; if (yaz_utf8_decoder(tocode, &cd->decoder)) return 1; if (yaz_ucs4_decoder(tocode, &cd->decoder)) -- 1.7.10.4