changeset 8909:87e171358001

[gaim-migrate @ 9679] (21:39:11) marv: LSchiere2: this strips the BOM from the inserted pasted text, while keeping it around during the conversation, thus making marcus's patch more better committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sun, 09 May 2004 01:39:42 +0000
parents a9ad52960c1c
children 26c9b8761707
files src/gtkimhtml.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkimhtml.c	Sat May 08 23:37:40 2004 +0000
+++ b/src/gtkimhtml.c	Sun May 09 01:39:42 2004 +0000
@@ -763,6 +763,7 @@
 	if (selection_data->length >= 2 &&
 		(*(guint16 *)text == 0xfeff || *(guint16 *)text == 0xfffe)) {
 		/* This is UCS-2 */
+		char *tmp;
 		char *utf8 = g_convert(text, selection_data->length, "UTF-8", "UCS-2", NULL, NULL, NULL);
 		g_free(text);
 		text = utf8;
@@ -770,6 +771,8 @@
 			gaim_debug_warning("gtkimhtml", "g_convert from UCS-2 failed in paste_received_cb\n");
 			return;
 		}
+		tmp = g_utf8_next_char(text);
+		memmove(text, tmp, strlen(tmp) + 1);
 	}
 
 	if (!(*text) || !g_utf8_validate(text, -1, NULL)) {