merge of '3911f16f4d0c5338685fcd9b83ce2635cfed4802'

Mon, 26 May 2008 02:16:05 +0000

author
Will Thompson <resiak@pidgin.im>
date
Mon, 26 May 2008 02:16:05 +0000
changeset 23336
0b46dc3c3f59
parent 23332
3911f16f4d0c (diff)
parent 23334
b59937f4ab22 (current diff)
child 23337
2643da079f95

merge of '3911f16f4d0c5338685fcd9b83ce2635cfed4802'
and 'b59937f4ab22518460f422b4b30a5290621e87c0'

--- a/pidgin/gtkimhtml.c	Sun May 25 23:48:50 2008 +0000
+++ b/pidgin/gtkimhtml.c	Mon May 26 02:16:05 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));

mercurial