Merge branch 'master' into sru_2_0
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 27 Sep 2013 13:16:06 +0000 (15:16 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 27 Sep 2013 13:16:06 +0000 (15:16 +0200)
include/yaz/yaz-iconv.h
src/marcdisp.c
src/utf8.c

index 4c763f7..4ce4e83 100644 (file)
@@ -65,7 +65,7 @@ YAZ_EXPORT int yaz_iconv_close (yaz_iconv_t cd);
 /** \brief tests whether conversion is handled by YAZ' iconv or system iconv */
 YAZ_EXPORT int yaz_iconv_isbuiltin(yaz_iconv_t cd);
 
-YAZ_EXPORT unsigned long yaz_read_UTF8_char(unsigned char *inp,
+YAZ_EXPORT unsigned long yaz_read_UTF8_char(const unsigned char *inp,
                                             size_t inbytesleft,
                                             size_t *no_read,
                                             int *error);
index 12ecb38..ad9eed6 100644 (file)
@@ -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 */
 }
 
index fcff6cd..1d2552b 100644 (file)
@@ -38,7 +38,7 @@ static size_t init_utf8(yaz_iconv_t cd, yaz_iconv_decoder_t d,
     return 0;
 }
 
-unsigned long yaz_read_UTF8_char(unsigned char *inp,
+unsigned long yaz_read_UTF8_char(const unsigned char *inp,
                                  size_t inbytesleft, size_t *no_read,
                                  int *error)
 {