rules: move the matcher result handling to the caller
[platform/upstream/libxkbcommon.git] / src / utf8.c
index a7fa82e..a76b001 100644 (file)
@@ -49,17 +49,13 @@ utf32_to_utf8(uint32_t unichar, char *buffer)
         length = 3;
         head = 0xe0;
     }
-    else if (unichar <= 0x1fffff) {
+    else if (unichar <= 0x10ffff) {
         length = 4;
         head = 0xf0;
     }
-    else if (unichar <= 0x3ffffff) {
-        length = 5;
-        head = 0xf8;
-    }
     else {
-        length = 6;
-        head = 0xfc;
+        buffer[0] = '\0';
+        return 0;
     }
 
     for (count = length - 1, shift = 0; count > 0; count--, shift += 6)