# HG changeset patch # User Paul Aurich # Date 1245739521 0 # Node ID 4ea129edc62c39c2f7ba247918b3214f7703452e # Parent 3b2a2469ffbfece1dd543612c986e030ddc26d59 Only append ,charset=utf-8 for DIGEST-MD5. This should fix comment 2 on Adium#12429. diff -r 3b2a2469ffbf -r 4ea129edc62c libpurple/protocols/jabber/auth.c --- a/libpurple/protocols/jabber/auth.c Mon Jun 22 23:39:56 2009 +0000 +++ b/libpurple/protocols/jabber/auth.c Tue Jun 23 06:45:21 2009 +0000 @@ -990,12 +990,16 @@ xmlnode_set_namespace(response, "urn:ietf:params:xml:ns:xmpp-sasl"); if (clen > 0) { /* Cyrus SASL 2.1.22 appears to contain code to add the charset - * to the response but there is no possibility it will be executed. + * to the response for DIGEST-MD5 but there is no possibility + * it will be executed. + * * My reading of the digestmd5 plugin indicates the username and * realm are always encoded in UTF-8 (they seem to be the values * we pass in), so we need to ensure charset=utf-8 is set. */ - if (strstr(c_out, ",charset=")) + if (!js->current_mech || !g_str_equal(js->current_mech, "DIGEST-MD5") || + strstr(c_out, ",charset=")) + /* If we're not using DIGEST-MD5 or Cyrus SASL is fixed */ enc_out = purple_base64_encode((unsigned char*)c_out, clen); else { char *tmp = g_strdup_printf("%s,charset=utf-8", c_out);