pidgin.2.4.3: 000a0fa4: *** Plucked rev da43d671 (sadrul at pidgin....

sadrul at pidgin.im sadrul at pidgin.im
Sat Jun 28 00:26:33 EDT 2008


-----------------------------------------------------------------
Revision: 000a0fa4bca9f18691f0a61e01bbac1aa76437c1
Ancestor: 260d5ee6ca276e761c5b0bd1b612edc5743eaf67
Author: sadrul at pidgin.im
Date: 2008-06-28T04:24:24
Branch: im.pidgin.pidgin.2.4.3
URL: http://d.pidgin.im/viewmtn/revision/info/000a0fa4bca9f18691f0a61e01bbac1aa76437c1

Modified files:
        pidgin/gtkimhtml.c

ChangeLog: 

*** Plucked rev da43d671 (sadrul at 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.


-------------- next part --------------
============================================================
--- pidgin/gtkimhtml.c	d09aceaac9d81a38ec9b5a0d393753b7a83e2ba2
+++ pidgin/gtkimhtml.c	e1c66d0dee8de5ba5c63ff1c3081facd93e2bf1a
@@ -950,19 +950,14 @@ static void gtk_imhtml_clipboard_get(Gtk
 		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));


More information about the Commits mailing list