summaryrefslogtreecommitdiff
path: root/navit/util.c
diff options
context:
space:
mode:
authorsleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-08-11 20:26:25 +0000
committersleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-08-11 20:26:25 +0000
commitb2b4ea881bff70f3f6f748c6c26f332b3962ea8f (patch)
tree90e65b2707333b8c47d6cab4d7557df2322ec354 /navit/util.c
parentafa961b8b380160b6c87b5153054cb8d3658458e (diff)
downloadnavit-b2b4ea881bff70f3f6f748c6c26f332b3962ea8f.tar.gz
Fix:core:Fix warnings by not using g_str(n)casecmp; new function navit_utf8_strcasecmp.|Part of #1154.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5572 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/util.c')
-rw-r--r--navit/util.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/navit/util.c b/navit/util.c
index 1599fce45..bdf0aa61b 100644
--- a/navit/util.c
+++ b/navit/util.c
@@ -53,6 +53,19 @@ strtolower(char *dest, const char *src)
*dest='\0';
}
+int
+navit_utf8_strcasecmp(const char *s1, const char *s2)
+{
+ char *s1_folded,*s2_folded;
+ int cmpres;
+ s1_folded=g_utf8_casefold(s1,-1);
+ s2_folded=g_utf8_casefold(s2,-1);
+ cmpres=strcmp(s1_folded,s2_folded);
+ dbg(3,"Compared %s with %s, got %d\n",s1_folded,s2_folded,cmpres);
+ g_free(s1_folded);
+ g_free(s2_folded);
+ return cmpres;
+}
static void
hash_callback(gpointer key, gpointer value, gpointer user_data)