]> granicus.if.org Git - mutt/commitdiff
Undo part of the character set canonicalization. EGE pointed out it
authorThomas Roessler <roessler@does-not-exist.org>
Wed, 13 Sep 2000 21:01:31 +0000 (21:01 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Wed, 13 Sep 2000 21:01:31 +0000 (21:01 +0000)
isn't needed.

rfc2047.c

index f5217984cc4a4551fe991222090a3b9e9a21cc5b..3dde035495f2f8194763bebc74e519f18d4059dd 100644 (file)
--- a/rfc2047.c
+++ b/rfc2047.c
@@ -357,7 +357,7 @@ static int rfc2047_encode (const char *d, size_t dlen, int col,
   size_t ulen, r, n, wlen;
   encoder_t encoder;
   char *tocode1 = 0;
-  char tocode[STRING];
+  const char *tocode;
   char *icode = "UTF-8";
 
   /* Try to convert to UTF-8. */
@@ -384,17 +384,18 @@ static int rfc2047_encode (const char *d, size_t dlen, int col,
   }
 
   /* Choose target charset. */
-  mutt_canonical_charset (tocode, sizeof (tocode), fromcode);
+  tocode = fromcode;
   if (icode)
   {
     if ((tocode1 = mutt_choose_charset (icode, charsets, u, ulen, 0, 0)))
-      mutt_canonical_charset (tocode, sizeof (tocode), tocode1);
+      tocode = tocode1;
     else
       ret = 2, icode = 0;
   }
-  
-  if (mutt_is_us_ascii (tocode))
-    strfcpy (tocode, "unknown-8bit", sizeof (tocode));
+
+  /* Hack to avoid labelling 8-bit data as us-ascii. */
+  if (!icode && mutt_is_us_ascii (tocode))
+    tocode = "unknown-8bit";
   
   /* Adjust t0 for maximum length of line. */
   t = u + (ENCWORD_LEN_MAX + 1) - col - ENCWORD_LEN_MIN;