ENOSIG Discussie (threads)


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sylpheed: Signed messages BASE64-encoded


Package: sylpheed
Version: 0.5.8-1
Severity: normal
Tags: patch

Sylpheed, in conformance with RFC 3156, Base64-encodes any clear
signed message that contains high bit characters. This is conforming,
as the RFC says one must use Base64 or Quoted-Printable, but:

Maybe the choice of Base64 makes sense for Japanese and other high-bit
rich languages, but is a nuisance for people receiving clear signed
messages with relatively few high bit characters, and whose MUA does
not automatically decode Base64. QP encoding is better in this case,
as the message is still human-readable, even if the MUA doesn't do
QP-decoding (the encoded characters can be guessed pretty easily, as
there are few of them, and human languages are very redundant).

I've prepared two patches to the (upstream) src/compose.c file:

 - The first one always uses QP encoding for signed messages that
   contain high-bit characters
 - The second one uses Base64 for the charsets I judged would
   typically have many high-bit characters. Feel free to adapt the
   list.
--- compose.c.upstream	Fri Oct 18 06:32:05 2002
+++ compose.c	Fri Oct 18 06:34:05 2002
@@ -2472,7 +2472,7 @@
 		if (!is_draft &&
 		    compose->use_signing && !compose->account->clearsign &&
 		    encoding == ENC_8BIT)
-			encoding = ENC_BASE64;
+			encoding = ENC_QUOTED_PRINTABLE;
 #endif
 
 		src_codeset = conv_get_current_charset_str();
--- compose.c.upstream	Fri Oct 18 06:32:05 2002
+++ compose.c	Fri Oct 18 06:44:32 2002
@@ -2472,7 +2472,28 @@
 		if (!is_draft &&
 		    compose->use_signing && !compose->account->clearsign &&
 		    encoding == ENC_8BIT)
-			encoding = ENC_BASE64;
+		  switch (out_codeset) {
+		  case C_KOI8_R:
+		  case C_KOI8_U:
+		  case C_ISO_2022_JP:
+		  case C_ISO_2022_JP_2:
+		  case C_EUC_JP:
+		  case C_SHIFT_JIS:
+		  case C_ISO_2022_KR:
+		  case C_EUC_KR:
+		  case C_ISO_2022_CN:
+		  case C_EUC_CN:
+		  case C_GB2312:
+		  case C_EUC_TW:
+		  case C_BIG5:
+		  case C_TIS_620:
+		  case C_WINDOWS_874:
+			encoding = ENC_QUOTED_PRINTABLE;
+			break;
+		  default:
+			encoding = ENC_QUOTED_PRINTABLE;
+			break;
+		  }
 #endif
 
 		src_codeset = conv_get_current_charset_str();


[ Date Index] [ Thread Index]