X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0413cec5271566470f4c852608a35800b49056cd..399b60a0ad232265cd74ce8bf6a53a1f2cc57ff2:/src/html/htmlfilt.cpp?ds=sidebyside diff --git a/src/html/htmlfilt.cpp b/src/html/htmlfilt.cpp index 350037cea1..95f90552d1 100644 --- a/src/html/htmlfilt.cpp +++ b/src/html/htmlfilt.cpp @@ -141,14 +141,26 @@ wxString wxHtmlFilterHTML::ReadFile(const wxFSFile& file) const char *src; wxString doc; - if (s == NULL) return wxEmptyString; + if (s == NULL) + { + wxLogError(_("Cannot open HTML document: %s"), file.GetLocation().mb_str()); + return wxEmptyString; + } src = new char[s -> GetSize() + 1]; src[s -> GetSize()] = 0; s -> Read(src, s -> GetSize()); 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(""); + return s; + } + + else return doc; }