]>
git.saurik.com Git - wxWidgets.git/blob - src/html/m_meta.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxHtml module for parsing <meta> tag
4 // Author: Vaclav Slavik
6 // Copyright: (c) 2000 Vaclav Slavik
7 // Licence: wxWindows Licence
8 /////////////////////////////////////////////////////////////////////////////
11 #pragma implementation
14 #include "wx/wxprec.h"
28 #include "wx/fontmap.h"
29 #include "wx/html/forcelnk.h"
30 #include "wx/html/m_templ.h"
31 #include "wx/html/htmlcell.h"
38 TAG_HANDLER_BEGIN(META
, "META")
42 if (tag
.HasParam(_T("HTTP-EQUIV")) &&
43 tag
.GetParam(_T("HTTP-EQUIV")) == _T("Content-Type") &&
44 tag
.HasParam(_T("CONTENT")))
46 wxString content
= tag
.GetParam(_T("CONTENT"));
47 if (content
.Left(19) == _T("text/html; charset="))
50 wxTheFontMapper
-> CharsetToEncoding(content
.Mid(19));
51 if (enc
== wxFONTENCODING_SYSTEM
) return FALSE
;
52 if (enc
== m_WParser
-> GetInputEncoding()) return FALSE
;
54 m_WParser
-> SetInputEncoding(enc
);
55 m_WParser
-> GetContainer() -> InsertCell(
56 new wxHtmlFontCell(m_WParser
-> CreateCurrentFont()));
65 TAGS_MODULE_BEGIN(MetaTag
)
69 TAGS_MODULE_END(MetaTag
)