Re: g_utf8_collate case sensitivity



Darin Adler <darin bentspoon com> writes:
> on 9/5/01 10:52 AM, Owen Taylor at otaylor redhat com wrote:
> 
> >> g_utf8_collate sorts ASCIIbetically case-sensitively (eg, 'Z' < 'a').
> >> That's a bug, right? (The docs say "Compares two strings for ordering
> >> using the linguistically correct rules for the current locale". I think
> >> the rules for my locale say that "bar" sorts before "Foo".)
> > 
> > The rules for the C locale generally have strcmp() ordering, I think.
> > 
> > g_utf8_collate() is just implemented in terms of strcoll() currently.
> 
> For this very reason, eel_strcoll uses strcoll outside "C" and "POSIX"
> locales, but uses eel_strcmp_case_breaks_ties in the "C" and "POSIX"
> locales.
> 
> It looks like we're still going to need an eel_strcoll (although we'll
> switch to g_utf8_collate and a UTF-8 version of
> eel_strcmp_case_breaks_ties).
> 
> Frankly, I'd strongly suggest providing a function with these kinds of
> semantics in glib -- it was my mistake not to bring this up when my remarks
> suggested g_utf8_collate.
> 

Of course, no one should be using the C locale anyhow...

Havoc




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