# HG changeset patch # User Elliott Sales de Andrade # Date 1234739318 0 # Node ID 15fc25014ce261aa8086e0d13b1308597e332089 # Parent 11458e8584c20327516b559ee320458477f376d6 Convert from ISO-8859-1 to UTF-8 if no charset is supplied. This should fix messages from old clients. Fixes #8423. diff -r 11458e8584c2 -r 15fc25014ce2 libpurple/protocols/msn/msg.c --- a/libpurple/protocols/msn/msg.c Sun Feb 15 22:52:47 2009 +0000 +++ b/libpurple/protocols/msn/msg.c Sun Feb 15 23:08:38 2009 +0000 @@ -352,6 +352,14 @@ memcpy(msg->body, tmp, msg->body_len); msg->body[msg->body_len] = '\0'; } + + if (msg->charset == NULL) { + char *body = g_convert(msg->body, msg->body_len, "UTF-8", + "ISO-8859-1", NULL, &msg->body_len, NULL); + g_free(msg->body); + msg->body = body; + msg->charset = g_strdup("UTF-8"); + } } g_free(tmp_base);