changeset 27561:aac25c66a843

For JIDs, do strdown before normalization. Having looked at the code for g_utf8_strdown(), this seems like it might help with the locale-dependence issues, although I'm not entirely sure.
author Paul Aurich <paul@darkrain42.org>
date Wed, 15 Jul 2009 22:41:52 +0000
parents 090dc513552f
children a0baa4da3217
files libpurple/protocols/jabber/jutil.c
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jutil.c	Wed Jul 15 22:31:10 2009 +0000
+++ b/libpurple/protocols/jabber/jutil.c	Wed Jul 15 22:41:52 2009 +0000
@@ -257,29 +257,29 @@
 
 	/* normalization */
 	if(at) {
-		node = g_utf8_normalize(str, at-str, G_NORMALIZE_NFKC);
+		node = g_utf8_strdown(str, at-str);
 		if(slash) {
-			domain = g_utf8_normalize(at+1, slash-(at+1), G_NORMALIZE_NFKC);
+			domain = g_utf8_strdown(at+1, slash-(at+1));
 			jid->resource = g_utf8_normalize(slash+1, -1, G_NORMALIZE_NFKC);
 		} else {
-			domain = g_utf8_normalize(at+1, -1, G_NORMALIZE_NFKC);
+			domain = g_utf8_strdown(at+1, -1);
 		}
 	} else {
 		if(slash) {
-			domain = g_utf8_normalize(str, slash-str, G_NORMALIZE_NFKC);
+			domain = g_utf8_strdown(str, slash-str);
 			jid->resource = g_utf8_normalize(slash+1, -1, G_NORMALIZE_NFKC);
 		} else {
-			domain = g_utf8_normalize(str, -1, G_NORMALIZE_NFKC);
+			domain = g_utf8_strdown(str, -1);
 		}
 	}
 
 	if (node) {
-		jid->node = g_utf8_strdown(node, -1);
+		jid->node = g_utf8_normalize(node, -1, G_NORMALIZE_NFKC);
 		g_free(node);
 	}
 
 	if (domain) {
-		jid->domain = g_utf8_strdown(domain, -1);
+		jid->domain = g_utf8_normalize(domain, -1, G_NORMALIZE_NFKC);
 		g_free(domain);
 	}