]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - utf8lib.c
(wtf8) wrap 4-bytes-sequence detection in ifdef U32
[xonotic/darkplaces.git] / utf8lib.c
index 18b5e09d4de73973b62df12875f2cf80c32449f2..1e34e707c978413cb8ef999db36a6e5dd24ecb8b 100644 (file)
--- a/utf8lib.c
+++ b/utf8lib.c
@@ -975,12 +975,15 @@ int fromwtf8(const char *cstr, int clen, wchar *wstr, int maxwlen)
                if ((byte & 0xf8) == 0xf8)
                        return -1;
                #endif
+               #if WTF8U32
                if ((byte & 0xf8) == 0xf0)
                {
                        length = 4;
                        point = byte & 0x07;
                }
-               else if ((byte & 0xf0) == 0xe0)
+               else
+               #endif
+               if ((byte & 0xf0) == 0xe0)
                {
                        length = 3;
                        point = byte & 0x0f;