From d69318b9c87d3714a0a944c1dc4c5289b15f82a4 Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Wed, 13 Sep 2000 21:01:31 +0000 Subject: [PATCH] Undo part of the character set canonicalization. EGE pointed out it isn't needed. --- rfc2047.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/rfc2047.c b/rfc2047.c index f5217984..3dde0354 100644 --- 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; -- 2.50.1