On 03 Jun 2001 19:36:07 -0400, Jon Trowbridge wrote: > I was doing a little grepping around in the evolution tree, and > noticed that we make heavy use of g_strcasecmp (109 instances) and > g_strncasecmp (54 instances). Of course, neither of these functions > is UTF-8 safe. > > I've added the following function to GAL, to be eventually merged back > into the glib-2.0 unicode routines. (Owen has already agreed to > accept the patch.) > > g_utf8_strcasecmp > g_utf8_strncasecmp > g_utf8_strdown > g_utf8_strup > > We should be using these instead of their non-UTF-8 counterparts. > > Also, we might want to do a mass s/g_strfoo/g_utf8_strfoo/g... though > it might not hurt to think about if there are places where we are > explicitly dealing with non-UTF-8 encodings and where this change > could cause problems. > A quick look revealed that a lot of the cases where we are currently using g_strcasecmp are equality tests on static strings that are us-ascii, these will work fine when comparing the ascii string to a utf-8 string for equality, so it seems like using the sed approach is a bit wasteful. --Larry _______________________________________________ evolution-hackers maillist - [EMAIL PROTECTED] http://lists.helixcode.com/mailman/listinfo/evolution-hackers
