2005-01-26 [paul] 1.0.0cvs15.2
authorPaul Mangan <paul@claws-mail.org>
Wed, 26 Jan 2005 07:08:39 +0000 (07:08 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 26 Jan 2005 07:08:39 +0000 (07:08 +0000)
* src/compose.c
compose_entries_set(): convert subject and body to
utf8 if necessary. patch by Felix Eckhofer

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/compose.c

index ba68c9d..e8f1fd8 100644 (file)
@@ -1,3 +1,9 @@
+2005-01-26 [paul]      1.0.0cvs15.2
+
+       * src/compose.c
+               compose_entries_set(): convert subject and body to
+               utf8 if necessary. patch by Felix Eckhofer
+
 2005-01-26 [paul]      1.0.0cvs15.1
 
        * configure.ac
index aa273ab..a1983c9 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.395.2.46 -r 1.395.2.47 src/summaryview.c; ) > 1.0.0cvs13.1.patchset
 ( cvs diff -u -r 1.654.2.377 -r 1.654.2.378 configure.ac; cvs diff -u -r 1.382.2.86 -r 1.382.2.87 src/compose.c; ) > 1.0.0cvs14.1.patchset
 ( cvs diff -u -r 1.654.2.378 -r 1.654.2.379 configure.ac; cvs diff -u -r 1.2.4.2 -r 1.2.4.3 src/common/template.c; ) > 1.0.0cvs15.1.patchset
+( cvs diff -u -r 1.382.2.87 -r 1.382.2.88 src/compose.c; ) > 1.0.0cvs15.2.patchset
index 1abed8c..323ee75 100644 (file)
@@ -13,7 +13,7 @@ INTERFACE_AGE=0
 BINARY_AGE=0
 EXTRA_VERSION=15
 EXTRA_RELEASE=
-EXTRA_GTK2_VERSION=.1
+EXTRA_GTK2_VERSION=.2
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
index 4bbad4e..7c83307 100644 (file)
@@ -1595,6 +1595,8 @@ static void compose_entries_set(Compose *compose, const gchar *mailto)
        gchar *bcc = NULL;
        gchar *subject = NULL;
        gchar *body = NULL;
+       gchar *temp = NULL;
+       gint  len = 0;
 
        scan_mailto_url(mailto, &to, &cc, &bcc, &subject, &body);
 
@@ -1605,7 +1607,13 @@ static void compose_entries_set(Compose *compose, const gchar *mailto)
        if (bcc)
                compose_entry_append(compose, bcc, COMPOSE_BCC);
        if (subject)
-               gtk_entry_set_text(GTK_ENTRY(compose->subject_entry), subject);
+               if (!g_utf8_validate (subject, -1, NULL)) {
+                       temp = g_locale_to_utf8 (subject, -1, NULL, &len, NULL);
+                       gtk_entry_set_text(GTK_ENTRY(compose->subject_entry), temp);
+                       g_free(temp);
+               } else {
+                       gtk_entry_set_text(GTK_ENTRY(compose->subject_entry), subject);
+               }
        if (body) {
                GtkTextView *text = GTK_TEXT_VIEW(compose->text);
                GtkTextBuffer *buffer = gtk_text_view_get_buffer(text);
@@ -1615,7 +1623,13 @@ static void compose_entries_set(Compose *compose, const gchar *mailto)
                mark = gtk_text_buffer_get_insert(buffer);
                gtk_text_buffer_get_iter_at_mark(buffer, &iter, mark);
 
-               gtk_text_buffer_insert(buffer, &iter, body, -1);
+               if (!g_utf8_validate (body, -1, NULL)) {
+                       temp = g_locale_to_utf8 (body, -1, NULL, &len, NULL);
+                       gtk_text_buffer_insert(buffer, &iter, temp, -1);
+                       g_free(temp);
+               } else {
+                       gtk_text_buffer_insert(buffer, &iter, body, -1);
+               }
                gtk_text_buffer_insert(buffer, &iter, "\n", 1);
        }