From 8ab79d5829863a8ffb1a27eb0ebb67f7e5f40241 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Thu, 11 Jul 2019 17:52:51 +0300 Subject: [PATCH] fix missing grapheme in mime encoded string --- melib/src/email/compose/mime.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/melib/src/email/compose/mime.rs b/melib/src/email/compose/mime.rs index 7eddb8c0..ebcb6658 100644 --- a/melib/src/email/compose/mime.rs +++ b/melib/src/email/compose/mime.rs @@ -11,10 +11,6 @@ pub fn encode_header(value: &str) -> String { (true, true) => { ret.push_str(g); } - (false, true) => { - current_window_start = idx; - is_current_window_ascii = false; - } (true, false) => { /* If !g.is_whitespace() * @@ -31,8 +27,14 @@ pub fn encode_header(value: &str) -> String { ret.push(' '); } is_current_window_ascii = true; + current_window_start = idx; + ret.push_str(g); } } + (false, true) => { + current_window_start = idx; + is_current_window_ascii = false; + } /* RFC2047 recommends: * 'While there is no limit to the length of a multiple-line header field, each line of * a header field that contains one or more 'encoded-word's is limited to 76