diff --git a/src/word.cpp b/src/word.cpp index b558b842..8e254865 100644 --- a/src/word.cpp +++ b/src/word.cpp @@ -125,7 +125,7 @@ ref word::parseNext if (!unencoded.empty()) { - if (prevIsEncoded) + if (prevIsEncoded && !isFirst) unencoded = whiteSpaces + unencoded; ref w = vmime::create (unencoded, defaultCharset); @@ -200,11 +200,13 @@ ref word::parseNext ++pos; } - if (startPos != end && !isFirst && prevIsEncoded) - unencoded += whiteSpaces; - if (startPos != end) + { + if (prevIsEncoded && !isFirst) + unencoded = whiteSpaces + unencoded; + unencoded += buffer.substr(startPos, end - startPos); + } // Treat unencoded text at the end of the buffer if (!unencoded.empty())