# HG changeset patch # User Luke Schierer # Date 1084066782 0 # Node ID 87e171358001a763d0c22eda99e76f042855c14c # Parent a9ad52960c1c26499be004dd38105e374f444276 [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 diff -r a9ad52960c1c -r 87e171358001 src/gtkimhtml.c --- 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)) {