CCL: fix use of "term" field in sub queries
[yaz-moved-to-github.git] / src / siconv.c
index 36dc4b2..0c974b8 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2008 Index Data
+ * Copyright (C) 1995-2012 Index Data
  * See the file LICENSE for details.
  */
 /**
 #include <assert.h>
 #include <errno.h>
 #include <string.h>
-#include <ctype.h>
 
 #if HAVE_ICONV_H
 #include <iconv.h>
 #endif
 
 #include <yaz/xmalloc.h>
-#include <yaz/nmem.h>
+#include <yaz/errno.h>
 #include "iconv-p.h"
 
 struct yaz_iconv_struct {
@@ -78,6 +77,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))
@@ -90,12 +91,14 @@ static int prepare_decoders(yaz_iconv_t cd, const char *tocode)
         return 1;
     if (yaz_wchar_decoder(tocode, &cd->decoder))
         return 1;
+    if (yaz_danmarc_decoder(tocode, &cd->decoder))
+        return 1;
     return 0;
 }
 
 yaz_iconv_t yaz_iconv_open(const char *tocode, const char *fromcode)
 {
-    yaz_iconv_t cd = (yaz_iconv_t) xmalloc (sizeof(*cd));
+    yaz_iconv_t cd = (yaz_iconv_t) xmalloc(sizeof(*cd));
 
     cd->encoder.data = 0;
     cd->encoder.write_handle = 0;
@@ -304,7 +307,9 @@ void yaz_iconv_set_errno(yaz_iconv_t cd, int no)
 /*
  * Local variables:
  * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
  * indent-tabs-mode: nil
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab
  */
+