]> mj.ucw.cz Git - libucw.git/blobdiff - lib/unicode-utf8.c
Cleaned up tracing levels. Array sorter now has its own control knob.
[libucw.git] / lib / unicode-utf8.c
index a52e553c55b44372bf27fca72da8fe7cc7461b9b..e4a33af8495f216bcbade228c55ce271a8f0f23c 100644 (file)
@@ -36,35 +36,6 @@ utf8_strnlen(const byte *str, uns n)
   return len;
 }
 
-uns
-utf8_check(const byte *s)
-{
-#define UTF8_CHECK_NEXT if (unlikely((*s & 0xc0) != 0x80)) goto bad; s++
-  while (*s)
-    {
-      uns u = *s++;
-      if (u < 0x80)
-       ;
-      else if (unlikely(u < 0xc0))
-        {
-bad:
-         return 0;
-       }
-      else if (u < 0xe0)
-        {
-         UTF8_CHECK_NEXT;
-       }
-      else if (likely(u < 0xf0))
-        {
-         UTF8_CHECK_NEXT;
-         UTF8_CHECK_NEXT;
-       }
-      else
-       goto bad;
-    }
-  return 1;
-}
-
 #ifdef TEST
 #include <string.h>
 #include <stdio.h>