Comparing strings in linux
Hi,
I am looking for a function which is equivalent to comparestring()(WIN32) function. Problem is the compariosion should be case insensitive and according to the local user settings.
Here is what I came upon till now.
strcoll() function can be used to compare the strings according to the user locale, but it is not case insensitive.
Using GTK I can use
g_utf8_casefold (), to make the two input strings case insensitive.
g_utf8_collate () to compare the strings according to the user locale.
The problem is both the functions require the strings input be UTF-8.
Can any one suggest a correct solution?
|