wxHtmlFilterHTML adds fake <meta> tag so that the parser knows charset

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5461 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2000-01-16 22:53:25 +00:00
parent 1e1d0be191
commit 981e62aa85

View File

@@ -130,7 +130,7 @@ bool wxHtmlFilterHTML::CanRead(const wxFSFile& file) const
// This is true in most case but some page can return:
// "text/html; char-encoding=...."
// So we use Find instead
return (file.GetMimeType().Find(wxT("text/html")) == 0);
return (file.GetMimeType().Find(_("text/html")) == 0);
}
@@ -148,7 +148,15 @@ wxString wxHtmlFilterHTML::ReadFile(const wxFSFile& file) const
doc = src;
delete[] src;
return doc;
// add meta tag if we obtained this through http:
if (file.GetMimeType().Find(_T("; charset=")) == 0)
{
wxString s(_T("<meta http-equiv=\"Content-Type\" content=\""));
s << file.GetMimeType() << _T("\">");
return s;
}
else return doc;
}