Reinsert initialiser for __UNUSED_loglevel
[yaz-moved-to-github.git] / src / siconv.c
index 9e5393b..8e062aa 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2005, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: siconv.c,v 1.15 2005-11-06 01:28:09 adam Exp $
+ * $Id: siconv.c,v 1.17 2006-02-10 12:45:39 adam Exp $
  */
 /**
  * \file siconv.c
@@ -133,7 +133,7 @@ static unsigned long yaz_read_UTF8 (yaz_iconv_t cd, unsigned char *inp,
     else if (inp[0] <= 0xef && inbytesleft >= 3)
     {
         x = ((inp[0] & 0x0f) << 12) | ((inp[1] & 0x3f) << 6) |
-            (inp[1] & 0x3f);
+            (inp[2] & 0x3f);
         if (x >= 0x800)
             *no_read = 3;
         else
@@ -265,6 +265,13 @@ static unsigned long yaz_read_marc8 (yaz_iconv_t cd, unsigned char *inp,
            We'll increment the no_read counter by 1, since we want to skip over
            the processing of the closing ligature character
         */
+        /* this code is no longer necessary.. our handlers code in
+           yaz_marc8_?_conv (generated by charconv.tcl) now returns
+           0 and no_read=1 when a sequence does not match the input.
+           The SECOND HALFs in codetables.xml produces a non-existant
+           entry in the conversion trie.. Hence when met, the input byte is
+           skipped as it should (in yaz_iconv)
+        */
 #if 0
         if (x == 0x0361 || x == 0x0360)
             *no_read += 1;