+static int enriched_cmp (const char *a, const wchar_t *b)
+{
+ register const char *p = a;
+ register const wchar_t *q = b;
+ int i;
+
+ if (!a && !b)
+ return 0;
+ if (!a && b)
+ return -1;
+ if (a && !b)
+ return 1;
+
+ for ( ; *p || *q; p++, q++)
+ {
+ if ((i = ascii_tolower (*p)) - ascii_tolower (((char) *q) & 0x7f))
+ return i;
+ }
+ return 0;
+}
+