html: handle the html5 charset meta tag
This commit is contained in:
parent
0d8a61ced9
commit
ec87379015
@ -391,7 +391,7 @@ MyHtmlParser::opening_tag(const string &tag)
|
|||||||
p.params.end()) {
|
p.params.end()) {
|
||||||
charset = k->second;
|
charset = k->second;
|
||||||
if (!samecharset(charset, fromcharset)) {
|
if (!samecharset(charset, fromcharset)) {
|
||||||
LOGDEB1(("Doc specified charset '%s' "
|
LOGDEB1(("Doc http-equiv charset '%s' "
|
||||||
"differs from dir deflt '%s'\n",
|
"differs from dir deflt '%s'\n",
|
||||||
charset.c_str(),
|
charset.c_str(),
|
||||||
fromcharset.c_str()));
|
fromcharset.c_str()));
|
||||||
@ -401,6 +401,19 @@ MyHtmlParser::opening_tag(const string &tag)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
string newcharset;
|
||||||
|
if (get_parameter(cstr_charset, newcharset)) {
|
||||||
|
// HTML5 added: <meta charset="...">
|
||||||
|
lowercase_term(newcharset);
|
||||||
|
charset = newcharset;
|
||||||
|
if (!samecharset(charset, fromcharset)) {
|
||||||
|
LOGDEB1(("Doc html5 charset '%s' "
|
||||||
|
"differs from dir deflt '%s'\n",
|
||||||
|
charset.c_str(),
|
||||||
|
fromcharset.c_str()));
|
||||||
|
throw false;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (tag == "marquee" || tag == "menu" || tag == "multicol")
|
if (tag == "marquee" || tag == "menu" || tag == "multicol")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user