Need to convert text/html to UTF-8 too, not just text/plain. So that

the spam classifier can handle those Russian HTML only spam messages.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14395 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexander G.M. Smith 2005-10-16 18:33:20 +00:00
parent 8e742b91ba
commit 47a6a63e35

View File

@ -437,10 +437,19 @@ status_t BTextMailComponent::GetDecodedData(BPositionIO *data) {
return B_IO_ERROR;
BMimeType type;
BMimeType textAny ("text");
ssize_t written;
if (MIMEType(&type) == B_OK && type == "text/plain")
if (MIMEType(&type) == B_OK && textAny.Contains (&type))
// Write out the string which has been both decoded from quoted
// printable or base64 etc, and then converted to UTF-8 from whatever
// character set the message specified. Do it for text/html,
// text/plain and all other text datatypes. Of course, if the message
// is HTML and specifies a META tag for a character set, it will now be
// wrong. But then we don't display HTML in BeMail, yet.
written = data->Write(text.String(),text.Length());
else
// Just write out whatever the binary contents are, only decoded from
// the quoted printable etc format.
written = data->Write(decoded.String(), decoded.Length());
return written >= 0 ? B_OK : written;