Checks for a charset in all words of a parameter in a parameterizedHeader.
Fixes filename encoding when the quoted-printable starts halfway, but if multiple charsets are used (unlikely) it may still fail (thanks to Zarafa).
This commit is contained in:
parent
555dcca979
commit
1d04b0a579
@ -248,7 +248,20 @@ void parameter::parse(const parsingContext& ctx, const std::vector <valueChunk>&
|
|||||||
value << t.getWholeBuffer();
|
value << t.getWholeBuffer();
|
||||||
|
|
||||||
if (!foundCharsetChunk)
|
if (!foundCharsetChunk)
|
||||||
ch = t.getWordAt(0)->getCharset();
|
{
|
||||||
|
// This is still wrong. Each word can have it's own charset, and can
|
||||||
|
// be mixed (eg. iso-8859-1 and iso-2022-jp), but very unlikely. Real
|
||||||
|
// fix is to have parameters store a vmime::text instead of a
|
||||||
|
// vmime::word in m_value. But that changes the interface.
|
||||||
|
for (size_t i = 0 ; i < t.getWordCount() ; ++i)
|
||||||
|
{
|
||||||
|
if (t.getWordAt(i)->getCharset() != ch && ch == charsets::US_ASCII)
|
||||||
|
{
|
||||||
|
ch = t.getWordAt(i)->getCharset();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user