]> mj.ucw.cz Git - libucw.git/commitdiff
Added a macro UTF8_SKIP for skipping a UTF-8 character without decoding it.
authorMartin Mares <mj@ucw.cz>
Fri, 14 Jun 2002 23:52:33 +0000 (23:52 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 14 Jun 2002 23:52:33 +0000 (23:52 +0000)
charset/unicode.h

index 50d4ed777024000a306ef445384a5fa037389a29..f12fff1add89fb3843bb99492358cacc224a84be 100644 (file)
@@ -102,6 +102,12 @@ static inline word Uunaccent(word x)
     else                               \
       u = *p++
 
+#define UTF8_SKIP(p) do {              \
+    if (*p++ >= 0xc0)                  \
+      while (*p >= 0x80 && *p < 0xc0)  \
+        p++;                           \
+  } while (0)
+
 #define UTF8_SPACE(u) ((u) < 0x80 ? 1 : (u) < 0x800 ? 2 : 3)
 
 uns ucs2_to_utf8(byte *, word *);