bug 56304, HTML ja signature displays as garbage in the mail body

bug 91670, Signature file with the charset different from the system on
r=ducarroz, sr=sspitzer
This commit is contained in:
loadrunner%betak.net 2001-08-22 00:02:01 +00:00
Родитель c183201b4c
Коммит d78b30cc3d
1 изменённых файлов: 16 добавлений и 1 удалений

Просмотреть файл

@ -2580,8 +2580,23 @@ nsMsgCompose::LoadDataFromFile(nsFileSpec& fSpec, nsString &sigData)
}
tempFile.close();
if (NS_FAILED(ConvertToUnicode(nsMsgI18NFileSystemCharset(), readBuf, sigData)))
nsAutoString sigEncoding;
sigEncoding.AssignWithConversion(nsMsgI18NParseMetaCharset(&fSpec));
//default to platform encoding for signature files w/o meta charset
if (sigEncoding.IsEmpty())
sigEncoding.Assign(nsMsgI18NFileSystemCharset());
if (NS_FAILED(ConvertToUnicode(sigEncoding, readBuf, sigData)))
sigData.AssignWithConversion(readBuf);
nsAutoString msgEncoding;
msgEncoding.AssignWithConversion(m_compFields->GetCharacterSet());
//change signature meta charset to the message charset, since they're gonna be co-mingled
if (!sigEncoding.Equals(msgEncoding))
sigData.ReplaceSubstring(sigEncoding, msgEncoding);
PR_FREEIF(readBuf);
return NS_OK;
}