X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=utf8.c;h=14510bc09818399944dee9b327aa8146469e7391;hb=cb12460b959ecb662f0fac610f0eaea0d9dbfe18;hp=68bd038ea400d8cbf11af7b70f0e8fe9f2f80aca;hpb=84fcd95d4ed6293fdaf03ffde7881dbb68cd979e;p=xonotic%2Fgmqcc.git diff --git a/utf8.c b/utf8.c index 68bd038..14510bc 100644 --- a/utf8.c +++ b/utf8.c @@ -31,12 +31,12 @@ static unsigned char utf8_lengths[256] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 - 0xBF are within multibyte sequences - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, * they could be interpreted as 2-byte starts but - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, * the codepoint would be < 127 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, * - 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, * C0 and C1 would also result in overlong encodings - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 - 0xBF are within multibyte sequences */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* they could be interpreted as 2-byte starts but */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* the codepoint would be < 127 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* */ + 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* C0 and C1 would also result in overlong encodings */ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* with F5 the codepoint is above 0x10FFFF, @@ -47,11 +47,11 @@ static unsigned char utf8_lengths[256] = { }; static uchar_t utf8_range[5] = { - 1, /* invalid - let's not allow the creation of 0-bytes :P - 1, * ascii minimum - 0x80, * 2-byte minimum - 0x800, * 3-byte minimum - 0x10000, * 4-byte minimum */ + 1, /* invalid - let's not allow the creation of 0-bytes :P */ + 1, /* ascii minimum */ + 0x80, /* 2-byte minimum */ + 0x800, /* 3-byte minimum */ + 0x10000, /* 4-byte minimum */ }; /** Analyze the next character and return various information if requested.