It looks like g_strncasecmp is deprecated, so I am looking for another function to do the same thing.
A:
g_ascii_strncasecmp
for pure ASCII and g_utf8_casefold
if you have UTF-8 strings.
Andreas Brinck
2009-12-08 09:17:25
+5
A:
From the docs at http://library.gnome.org/devel/glib/stable/glib-String-Utility-Functions.html#g-strncasecmp
"There are therefore two replacement functions: g_ascii_strncasecmp(), which only works on ASCII and is not locale-sensitive, and g_utf8_casefold(), which is good for case-insensitive sorting of UTF-8."
William Billingsley
2009-12-08 09:17:41
A:
If you're going to be comparing a lot of the same strings, you can gain some speed by creating collation keys. Do this using g_utf8_collate_key()
, you can then compare the keys case-insensitively using g_ascii_strcmp()
since the collation key is an ASCII string.
unwind
2009-12-08 09:17:59