2006-03-26 [colin] 2.0.0cvs173
authorColin Leroy <colin@colino.net>
Sun, 26 Mar 2006 17:12:13 +0000 (17:12 +0000)
committerColin Leroy <colin@colino.net>
Sun, 26 Mar 2006 17:12:13 +0000 (17:12 +0000)
* src/quote_fmt_parse.y
Fix non-UTF8 date formats fucking up the whole quote

ChangeLog
PATCHSETS
configure.ac
src/quote_fmt_parse.y

index e752e6ea63308733825323a0d455bf38feedcfd4..fdb79013c8f7ca6c9f1be48f8279eb1c2ca3b185 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-03-26 [colin]     2.0.0cvs173
+
+       * src/quote_fmt_parse.y
+               Fix non-UTF8 date formats fucking up the whole quote
+
 2006-03-26 [colin]     2.0.0cvs172
 
        * src/procheader.c
index 81e1aa773835fbfe1f6389b510f1f51ee428c32d..a3a0f4688b11ca889245d3b859e14d0809212444 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.395.2.187 -r 1.395.2.188 src/summaryview.c;  ) > 2.0.0cvs170.patchset
 ( cvs diff -u -r 1.75.2.18 -r 1.75.2.19 src/matcher.c;  ) > 2.0.0cvs171.patchset
 ( cvs diff -u -r 1.47.2.27 -r 1.47.2.28 src/procheader.c;  cvs diff -u -r 1.382.2.255 -r 1.382.2.256 src/compose.c;  ) > 2.0.0cvs172.patchset
+( cvs diff -u -r 1.22.2.19 -r 1.22.2.20 src/quote_fmt_parse.y;  ) > 2.0.0cvs173.patchset
index 6c34038c8ba54ce128f931b56c91404c0c6744e8..8597e69f69868980d3aedada73fff67dc82610a1 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=0
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=172
+EXTRA_VERSION=173
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index e345257396df6842fecebd8a40324be9861d5fdf..3399ffc05b7496e304b68ccec0c14d8c97b9ad0e 100644 (file)
@@ -27,6 +27,7 @@
 #include "procmsg.h"
 #include "procmime.h"
 #include "utils.h"
+#include "codeconv.h"
 #include "procheader.h"
 
 #include "quote_fmt.h"
@@ -211,7 +212,24 @@ static void quote_fmt_show_date(const MsgInfo *msginfo, const gchar *format)
                        }
                }
                
-               INSERT(result);
+               if (g_utf8_validate(result, -1, NULL)) {
+                       INSERT(result);
+               } else {
+                       gchar *utf = conv_codeset_strdup(result, 
+                               conv_get_locale_charset_str_no_utf8(),
+                               CS_INTERNAL);
+                       if (utf == NULL || 
+                           !g_utf8_validate(utf, -1, NULL)) {
+                               g_free(utf);
+                               utf = g_malloc(strlen(result)*2+1);
+                               conv_localetodisp(utf, 
+                                       strlen(result)*2+1, result);
+                       }
+                       if (g_utf8_validate(utf, -1, NULL)) {
+                               INSERT(utf);
+                       }
+                       g_free(utf);
+               }
        }
 #undef STR_SIZE                        
 #undef RLEFT