X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/223d09f6b523aac674ef9b72a883dfa8d37c5d4e..052e12db71e84fef1c7209daf931a056ad965918:/src/html/htmlfilt.cpp diff --git a/src/html/htmlfilt.cpp b/src/html/htmlfilt.cpp index bb55c450cc..199b91c6c4 100644 --- a/src/html/htmlfilt.cpp +++ b/src/html/htmlfilt.cpp @@ -14,6 +14,7 @@ #include "wx/wxprec.h" +#include "wx/defs.h" #if wxUSE_HTML #ifdef __BORDLANDC__ @@ -63,8 +64,8 @@ wxString wxHtmlFilterPlainText::ReadFile(const wxFSFile& file) const doc = src; delete [] src; - doc.Replace("<", "<", TRUE); - doc.Replace(">", ">", TRUE); + doc.Replace(wxT("<"), wxT("<"), TRUE); + doc.Replace(wxT(">"), wxT(">"), TRUE); doc2 = "
\n" + doc + "\n
"; return doc2; } @@ -93,7 +94,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxHtmlFilterImage, wxHtmlFilter) bool wxHtmlFilterImage::CanRead(const wxFSFile& file) const { - return (file.GetMimeType().Left(6) == "image/"); + return (file.GetMimeType().Left(6) == wxT("image/")); } @@ -129,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); } @@ -147,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(""); + return s; + } + + else return doc; }