Re: g_utf8_collate case sensitivity



> I feel a bit uncomfortable second-guessing strcoll() because:
> 
>  - maybe strcoll() in the C locale is implemented to do
>    something smarter than strcmp().

I just checked the UNIX98 spec. It's defined to collate as US-ASCII for
US-ASCII strings, and undefined for 8-bit data:
http://www.opengroup.org/onlinepubs/007908799/xbd/locale.html#tag_005_003_002_005

>  - g_utf8_casefold() isn't exactly speedy.

So how about adding g_utf8_strcasecmp() that uses casefold_table[]
directly, so it doesn't need to malloc, and can stop folding once the
strings stop matching? And then make g_utf8_collate use that for
C/POSIX.

If that's an ok solution, I'll write the code.

-- Dan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]