# HG changeset patch # User Elliott Sales de Andrade # Date 1249013064 0 # Node ID 4362f871369c79993fad1cf5e84dad889ecc0335 # Parent 6c9c6123b942915a500f6246c50578ce493df77a Using g_convert instead of g_utf16_to_utf8 so that we can explicitly set the input byte order. It should always be little-endian and not depend on the host order. diff -r 6c9c6123b942 -r 4362f871369c libpurple/protocols/msn/slpcall.c --- a/libpurple/protocols/msn/slpcall.c Fri Jul 31 03:53:00 2009 +0000 +++ b/libpurple/protocols/msn/slpcall.c Fri Jul 31 04:04:24 2009 +0000 @@ -206,12 +206,12 @@ { /* This is for handwritten messages (Ink) */ GError *error; - glong items_read, items_written; + gsize bytes_read, bytes_written; - body_str = g_utf16_to_utf8((gunichar2 *)body, body_len / 2, - &items_read, &items_written, &error); - body_len -= items_read * 2 + 2; - body += items_read * 2 + 2; + body_str = g_convert(body, body_len / 2, "UTF16-LE", "UTF-8", + &bytes_read, &bytes_written, &error); + body_len -= bytes_read + 2; + body += bytes_read + 2; if (body_str == NULL || body_len <= 0 || strstr(body_str, "image/gif") == NULL) @@ -228,8 +228,8 @@ } g_free(body_str); - body_str = g_utf16_to_utf8((gunichar2 *)body, body_len / 2, - &items_read, &items_written, &error); + body_str = g_convert(body, body_len / 2, "UTF16-LE", "UTF-8", + &bytes_read, &bytes_written, &error); if (!body_str) { purple_debug_error("msn",