]>
git.saurik.com Git - wxWidgets.git/blob - src/html/m_meta.cpp
9ad9eb7c4bb36a43e6b9c47200df2da5fbba35d8
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"
18 #if wxUSE_HTML && wxUSE_STREAMS
27 #include "wx/fontmap.h"
28 #include "wx/html/forcelnk.h"
29 #include "wx/html/m_templ.h"
30 #include "wx/html/htmlcell.h"
37 TAG_HANDLER_BEGIN(META
, "META")
41 if (tag
.HasParam(_T("HTTP-EQUIV")) &&
42 tag
.GetParam(_T("HTTP-EQUIV")) == _T("Content-Type") &&
43 tag
.HasParam(_T("CONTENT")))
45 wxString content
= tag
.GetParam(_T("CONTENT"));
46 if (content
.Left(19) == _T("text/html; charset="))
49 wxFontMapper::Get()->CharsetToEncoding(content
.Mid(19));
50 if (enc
== wxFONTENCODING_SYSTEM
) return FALSE
;
51 if (enc
== m_WParser
->GetInputEncoding()) return FALSE
;
53 m_WParser
->SetInputEncoding(enc
);
54 m_WParser
->GetContainer()->InsertCell(
55 new wxHtmlFontCell(m_WParser
->CreateCurrentFont()));
64 TAGS_MODULE_BEGIN(MetaTag
)
68 TAGS_MODULE_END(MetaTag
)