2004-10-14 [colin] 0.9.12cvs126.2
authorColin Leroy <colin@colino.net>
Thu, 14 Oct 2004 10:22:30 +0000 (10:22 +0000)
committerColin Leroy <colin@colino.net>
Thu, 14 Oct 2004 10:22:30 +0000 (10:22 +0000)
* src/codeconv.c
* src/textview.c
Fix conv_unreadable_locale

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/codeconv.c
src/textview.c

index b53d9084f08948e72216f5ed2b56855201b1fea5..ea3009eed34804df80222d84216ca2981c9ab3ec 100644 (file)
@@ -1,3 +1,9 @@
+2004-10-14 [colin]     0.9.12cvs126.2
+
+       * src/codeconv.c
+       * src/textview.c
+               Fix conv_unreadable_locale
+
 2004-10-13 [colin]     0.9.12cvs126.1
 
        * src/compose.c
index 09ad7b24e2032df1b430ca40c2f8e65baa5ea0ec..347773cb90a201af54f729b6352c7742e7b3fb9c 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.49 -r 1.382.2.50 src/compose.c; ) > 0.9.12cvs124.3.patchset
 ( cvs diff -u -r 1.53.2.6 -r 1.53.2.7 po/POTFILES.in; ) > 0.9.12cvs125.1.patchset
 ( cvs diff -u -r 1.382.2.50 -r 1.382.2.51 src/compose.c; ) > 0.9.12cvs126.1.patchset
+( cvs diff -u -r 1.65.2.13 -r 1.65.2.14 src/codeconv.c; cvs diff -u -r 1.96.2.21 -r 1.96.2.22 src/textview.c; ) > 0.9.12cvs126.2.patchset
index 52056a21c27b0c1607b6645e4e126c34a66754cb..275327b99dd4e8ccda40c5edbea2fef6d4b5d70a 100644 (file)
@@ -13,7 +13,7 @@ INTERFACE_AGE=0
 BINARY_AGE=0
 EXTRA_VERSION=126
 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 33325b70ef99fbd4f74879e748fb77bdb5f8ed23..12c8e93953fcd47b59ca15e4936e9b84030903b8 100644 (file)
@@ -47,7 +47,7 @@ typedef enum
        JIS_AUXKANJI
 } JISState;
 
-#define SUBST_CHAR     '_'
+#define SUBST_CHAR     0x5f;
 #define ESC            '\033'
 
 #define iseuckanji(c) \
@@ -574,6 +574,22 @@ void conv_unreadable_latin(gchar *str)
        }
 }
 
+void conv_unreadable_utf8(gchar *str)
+{
+       register guchar *p = str;
+
+       while (*p != '\0') {
+               /* convert CR+LF -> LF */
+               printf("p %c (%d)\n", *p, *p);
+               if (*p == '\r' && *(p + 1) == '\n')
+                       memmove(p, p + 1, strlen(p));
+               else if (((*p & 0xff) >= 0x7f && (*p & 0xff) <= 0x9f) 
+                        || *p == 0xfc)
+                       *p = SUBST_CHAR;
+               p++;
+       }
+}
+
 void conv_unreadable_locale(gchar *str)
 {
        switch (conv_get_current_charset()) {
@@ -597,6 +613,9 @@ void conv_unreadable_locale(gchar *str)
        case C_EUC_JP:
                conv_unreadable_eucjp(str);
                break;
+       case C_UTF_8:
+               conv_unreadable_utf8(str);
+               break;
        default:
                break;
        }
index 47ad7b0821c493e5e388dabf70e6da924f68ee22..e23d2a32621e19b4142e2313db14207e8d81a46b 100644 (file)
@@ -1074,10 +1074,11 @@ static void textview_write_line(TextView *textview, const gchar *str,
        buffer = gtk_text_view_get_buffer(text);
        gtk_text_buffer_get_end_iter(buffer, &iter);
 
-       if (!conv)
-               strncpy2(buf, str, sizeof(buf));
-       else if (conv_convert(conv, buf, sizeof(buf), str) < 0)
+       if (!conv) {
                strncpy2(buf, str, sizeof(buf));
+       } else if (conv_convert(conv, buf, sizeof(buf), str) < 0) {
+               conv_localetodisp(buf, sizeof(buf), str);
+       }
 
        strcrchomp(buf);
        if (prefs_common.conv_mb_alnum) conv_mb_alnum(buf);