# HG changeset patch # User Sadrul Habib Chowdhury # Date 1211759337 0 # Node ID 66ccd61eaff6de7fa259d4c29a783a80401a118f # Parent 7e0b815d21339b92e4774211439395ff5d519d9a# Parent ed61297e80c8db385e81fcaea0f1124434f9b34b merge of 'd993fb67df1d01ad9a8a18fef3e8a5de90823875' and 'da43d67131d318f67d21afc95a349c3ab8ef8c92' diff -r 7e0b815d2133 -r 66ccd61eaff6 pidgin/gtkimhtml.c --- a/pidgin/gtkimhtml.c Sun May 25 22:06:51 2008 +0000 +++ b/pidgin/gtkimhtml.c Sun May 25 23:48:57 2008 +0000 @@ -1001,19 +1001,14 @@ char *selection; #ifndef _WIN32 gsize len; - GString *str = g_string_new(NULL); if (primary) { text = gtk_imhtml_get_markup_range(imhtml, &start, &end); } else text = html_clipboard; /* Mozilla asks that we start our text/html with the Unicode byte order mark */ - str = g_string_append_unichar(str, 0xfeff); - str = g_string_append(str, text); - str = g_string_append_unichar(str, 0x0000); - selection = g_convert(str->str, str->len, "UTF-16", "UTF-8", NULL, &len, NULL); + selection = g_convert(text, -1, "UTF-16", "UTF-8", NULL, &len, NULL); gtk_selection_data_set(selection_data, gdk_atom_intern("text/html", FALSE), 16, (const guchar *)selection, len); - g_string_free(str, TRUE); #else selection = clipboard_html_to_win32(html_clipboard); gtk_selection_data_set(selection_data, gdk_atom_intern("HTML Format", FALSE), 8, (const guchar *)selection, strlen(selection));