2004-09-14 [colin] 0.9.12cvs99.4
authorColin Leroy <colin@colino.net>
Tue, 14 Sep 2004 12:52:12 +0000 (12:52 +0000)
committerColin Leroy <colin@colino.net>
Tue, 14 Sep 2004 12:52:12 +0000 (12:52 +0000)
* src/action.c
Fix action output with utf8
Patch by Alfons.

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

index 140687b0e02abbd6cea26c2164a5e6a6054f69df..27d8de914b5efeb8c3e0438afa468c14d6cd27b8 100644 (file)
@@ -1,3 +1,9 @@
+2004-09-14 [colin]     0.9.12cvs99.4
+
+       * src/action.c
+               Fix action output with utf8 
+               Patch by Alfons.
+
 2004-09-14 [colin]     0.9.12cvs99.3
 
        * ChangeLog.claws
index 62da4adda274e3fd3569da9c43f55c6f28bf5e4a..6b2dcf726e7977ed0aa5751ce1f5babcfb36a5fb 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.61.2.10 -r 1.61.2.11 src/account.c; cvs diff -u -r 1.213.2.15 -r 1.213.2.16 src/folder.c; cvs diff -u -r 1.150.2.8 -r 1.150.2.9 src/procmsg.c; cvs diff -u -r 1.60.2.7 -r 1.60.2.8 src/procmsg.h; cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/plugins/pgpmime/pgpmime.c; ) > 0.9.12cvs99.1.patchset
 ( cvs diff -u -r 1.12.2.10 -r 1.12.2.11 src/action.c; ) > 0.9.12cvs99.2.patchset
 ( cvs diff -u -r 1.2504.2.19 -r 1.2504.2.20 ChangeLog.claws; cvs diff -u -r 1.213.2.16 -r 1.213.2.17 src/folder.c; ) > 0.9.12cvs99.3.patchset
+( cvs diff -u -r 1.12.2.11 -r 1.12.2.12 src/action.c; ) > 0.9.12cvs99.4.patchset
index b0e218136d6c86e447f4fc1dbe5a4e17a2ff5499..3f3f95a849a6289d83359dd55ab499127ad5a070 100644 (file)
@@ -13,7 +13,7 @@ INTERFACE_AGE=0
 BINARY_AGE=0
 EXTRA_VERSION=99
 EXTRA_RELEASE=
-EXTRA_GTK2_VERSION=.3
+EXTRA_GTK2_VERSION=.4
 
 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 242d4b49449291b554932835e486643e4490523c..e5b8a6179fbd368f22d24454a962fa7db1e0f118 100644 (file)
@@ -1309,7 +1309,18 @@ static void catch_output(gpointer data, gint source, GdkInputCondition cond)
                        c = read(source, buf, sizeof(buf) - 1);
                        if (c == 0)
                                break;
-                       gtk_text_buffer_insert(textbuf, &iter2, buf, c);
+                       else {
+                               gssize by_read = 0, by_written = 0;
+                               gchar *ret_str = g_locale_to_utf8(buf, c, &by_read,
+                                                                 &by_written, NULL);
+                                                                 
+                               if (ret_str && by_written) {
+                                       gtk_text_buffer_insert(textbuf, &iter2, 
+                                                              ret_str, by_written);
+                                       g_free(ret_str);
+                               } else
+                                       gtk_text_buffer_insert(textbuf, &iter2, buf, c);
+                       }                               
                }
                if (child_info->children->is_selection) {
                        gtk_text_buffer_place_cursor(textbuf, &iter1);
@@ -1318,8 +1329,20 @@ static void catch_output(gpointer data, gint source, GdkInputCondition cond)
                }
        } else {
                c = read(source, buf, sizeof(buf) - 1);
-               for (i = 0; i < c; i++)
-                       g_string_append_c(child_info->output, buf[i]);
+               
+               if (c > 0) {
+                       gssize by_read = 0, by_written = 0;
+                       gchar *ret_str = g_locale_to_utf8(buf, c, &by_read,
+                                                         &by_written, NULL);
+                                                         
+                       if (ret_str && by_written) {
+                               g_string_append_len(child_info->output,
+                                                   ret_str, by_written);
+                               g_free(ret_str);                                                    
+                       } else
+                               g_string_append_len(child_info->output, buf, c);
+               }
+               
                if (c > 0)
                        child_info->new_out = TRUE;
        }