X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0413cec5271566470f4c852608a35800b49056cd..4a64bee465c0dbf3d97fbf290cb2fef4ad41ca34:/src/html/htmlfilt.cpp 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; }