From fd853deb849f5b72004d4ed4d48b591dc5d50356 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 14 Jun 2002 23:52:33 +0000 Subject: [PATCH] Added a macro UTF8_SKIP for skipping a UTF-8 character without decoding it. --- charset/unicode.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/charset/unicode.h b/charset/unicode.h index 50d4ed77..f12fff1a 100644 --- a/charset/unicode.h +++ b/charset/unicode.h @@ -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 *); -- 2.39.5