From 40d3a64ef2d3b52ef422ad5ef55f03bba73bc702 Mon Sep 17 00:00:00 2001 From: Oliver Lehmann Date: Thu, 21 Oct 2004 20:47:59 +0000 Subject: In case the header is not 7bit clean, gtk20 has problems displaying it correctly (because then it is not utf8 valid as well) Force converting the header and the xover data (usenet) to utf-8 in case it isn't 7bit clean by assuming the header was written in the charset locale(1) reports. That might be wrong, but I see no other way. We can't detect the charset in which the header was written in (for example, xover data doesn't have any informations in it about content-type) because Content-Type only affecty the message-body. Approved By: maintainer (implicit) Taken From: sylpheed-claws gtk2 CVS branch --- mail/sylpheed-gtk2/files/patch-encoding | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'mail/sylpheed-gtk2/files/patch-encoding') diff --git a/mail/sylpheed-gtk2/files/patch-encoding b/mail/sylpheed-gtk2/files/patch-encoding index e7f74b25709b..3522a934e587 100644 --- a/mail/sylpheed-gtk2/files/patch-encoding +++ b/mail/sylpheed-gtk2/files/patch-encoding @@ -20,3 +20,27 @@ if (conv_str) { len = strlen(conv_str); memcpy(outp, conv_str, len); +--- src/codeconv.c.orig Thu Oct 21 22:08:15 2004 ++++ src/codeconv.c Thu Oct 21 22:08:34 2004 +@@ -1651,8 +1651,20 @@ + Xalloca(buf, buflen, return); + conv_anytodisp(buf, buflen, str); + unmime_header(outbuf, buf); +- } else ++ } else { ++ gchar *tmp; + unmime_header(outbuf, str); ++ if (outbuf && !g_utf8_validate(outbuf, -1, NULL)) { ++ tmp = conv_codeset_strdup(outbuf, ++ conv_get_current_charset_str(), ++ CS_UTF_8); ++ if (tmp) { ++ strncpy(outbuf, tmp, outlen-1); ++ g_free(tmp); ++ } ++ } ++ } ++ + } + + #define MAX_LINELEN 76 -- cgit v1.2.3