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:
@@ -130,7 +130,7 @@ bool wxHtmlFilterHTML::CanRead(const wxFSFile& file) const
|
|||||||
// This is true in most case but some page can return:
|
// This is true in most case but some page can return:
|
||||||
// "text/html; char-encoding=...."
|
// "text/html; char-encoding=...."
|
||||||
// So we use Find instead
|
// 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;
|
doc = src;
|
||||||
delete[] 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user