# HG changeset patch # User Sadrul Habib Chowdhury # Date 1214627064 0 # Node ID 7b77449957916f1766575cd53cad5b693dc820e9 # Parent 00b4424215637ddf617250263f86a23cfe4627db *** Plucked rev da43d671 (sadrul@pidgin.im): Do not prepend the BOM when converting from UTF-8 to UTF-16, since g_convert seems to do that for us. Closes #5915. Fixes #5515. diff -r 00b442421563 -r 7b7744995791 pidgin/gtkimhtml.c --- a/pidgin/gtkimhtml.c Thu Jun 26 19:08:38 2008 +0000 +++ b/pidgin/gtkimhtml.c Sat Jun 28 04:24:24 2008 +0000 @@ -950,19 +950,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));