/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Sylpheed-Claws team
+ * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
if (head)
gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, head, -1,
tag, NULL);
- gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, logtext->text, -1,
- tag, NULL);
+ if (!g_utf8_validate(logtext->text, -1, NULL)) {
+ gchar * mybuf = g_malloc(strlen(logtext->text)*2 +1);
+ conv_localetodisp(mybuf, strlen(logtext->text)*2 +1, logtext->text);
+ gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, mybuf, -1,
+ tag, NULL);
+ g_free(mybuf);
+ } else {
+ gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, logtext->text, -1,
+ tag, NULL);
+ }
gtk_text_buffer_get_start_iter(buffer, &iter);
if (logwindow->clip)