Mercurial > pidgin
comparison libpurple/protocols/jabber/jutil.c @ 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 | f1f901b3d6f2 |
children | e5fdfff98aa9 |
comparison
equal
deleted
inserted
replaced
27560:090dc513552f | 27561:aac25c66a843 |
---|---|
255 | 255 |
256 jid = g_new0(JabberID, 1); | 256 jid = g_new0(JabberID, 1); |
257 | 257 |
258 /* normalization */ | 258 /* normalization */ |
259 if(at) { | 259 if(at) { |
260 node = g_utf8_normalize(str, at-str, G_NORMALIZE_NFKC); | 260 node = g_utf8_strdown(str, at-str); |
261 if(slash) { | 261 if(slash) { |
262 domain = g_utf8_normalize(at+1, slash-(at+1), G_NORMALIZE_NFKC); | 262 domain = g_utf8_strdown(at+1, slash-(at+1)); |
263 jid->resource = g_utf8_normalize(slash+1, -1, G_NORMALIZE_NFKC); | 263 jid->resource = g_utf8_normalize(slash+1, -1, G_NORMALIZE_NFKC); |
264 } else { | 264 } else { |
265 domain = g_utf8_normalize(at+1, -1, G_NORMALIZE_NFKC); | 265 domain = g_utf8_strdown(at+1, -1); |
266 } | 266 } |
267 } else { | 267 } else { |
268 if(slash) { | 268 if(slash) { |
269 domain = g_utf8_normalize(str, slash-str, G_NORMALIZE_NFKC); | 269 domain = g_utf8_strdown(str, slash-str); |
270 jid->resource = g_utf8_normalize(slash+1, -1, G_NORMALIZE_NFKC); | 270 jid->resource = g_utf8_normalize(slash+1, -1, G_NORMALIZE_NFKC); |
271 } else { | 271 } else { |
272 domain = g_utf8_normalize(str, -1, G_NORMALIZE_NFKC); | 272 domain = g_utf8_strdown(str, -1); |
273 } | 273 } |
274 } | 274 } |
275 | 275 |
276 if (node) { | 276 if (node) { |
277 jid->node = g_utf8_strdown(node, -1); | 277 jid->node = g_utf8_normalize(node, -1, G_NORMALIZE_NFKC); |
278 g_free(node); | 278 g_free(node); |
279 } | 279 } |
280 | 280 |
281 if (domain) { | 281 if (domain) { |
282 jid->domain = g_utf8_strdown(domain, -1); | 282 jid->domain = g_utf8_normalize(domain, -1, G_NORMALIZE_NFKC); |
283 g_free(domain); | 283 g_free(domain); |
284 } | 284 } |
285 | 285 |
286 /* and finally the jabber nodeprep */ | 286 /* and finally the jabber nodeprep */ |
287 if(!jabber_nodeprep_validate(jid->node) || | 287 if(!jabber_nodeprep_validate(jid->node) || |