From: <ebl...@us...> - 2006-12-14 04:17:04
|
Revision: 17992 http://svn.sourceforge.net/gaim/?rev=17992&view=rev Author: eblanton Date: 2006-12-13 20:17:02 -0800 (Wed, 13 Dec 2006) Log Message: ----------- Attempt to salvage Oscar strings in an invalid encoding, as well as print an error message. Modified Paths: -------------- trunk/libgaim/protocols/oscar/oscar.c Modified: trunk/libgaim/protocols/oscar/oscar.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar.c 2006-12-14 01:47:25 UTC (rev 17991) +++ trunk/libgaim/protocols/oscar/oscar.c 2006-12-14 04:17:02 UTC (rev 17992) @@ -426,9 +426,18 @@ ret = gaim_plugin_oscar_convert_to_utf8(data, datalen, charsetstr1, FALSE); if (ret == NULL) ret = gaim_plugin_oscar_convert_to_utf8(data, datalen, charsetstr2, TRUE); - if (ret == NULL) - ret = g_strdup(_("(There was an error receiving this message. Either you and the buddy you are speaking to have a different encoding selected, or the buddy has a buggy client.)")); + if (ret == NULL) { + char *str, *salvage; + str = g_malloc(datalen + 1); + strncpy(str, datalen, data); + str[datalen] = '\0'; + salvage = gaim_utf8_salvage(str); + ret = g_strdup_printf(_("%s (There was an error receiving this message. Either you and the buddy you are speaking to have a different encoding selected, or the buddy has a buggy client.)"), salvage); + g_free(str); + g_free(salvage); + } + return ret; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |