fix charset detection in CHM

This commit is contained in:
nlopess
2005-02-13 22:50:06 +00:00
parent 8b184bd7b2
commit 6d9dd89e1a
2 changed files with 2 additions and 2 deletions

View File

@@ -61,7 +61,7 @@ function convertCharset($buf)
// Returns the name of character set in the given document
function detectDocumentCharset($doc)
{
if (preg_match("/<META\\s+HTTP-EQUIV=\"CONTENT-TYPE\"\\s+CONTENT=\"TEXT\\/HTML;\\s+CHARSET=([\\w\\d-]*)\"\\s*>/iU", $doc, $reg)) {
if (preg_match('/<META[^>]+CHARSET=["\'\s]?([\w\d-]+)["\'\s]?\s*>/iS', $doc, $reg)) {
return $reg[1];
}
return false;

View File

@@ -10,7 +10,7 @@
<TABLE BORDER="0" WIDTH="100%" HEIGHT="100%" CELLSPACING="0" CELLPADDING="0">
<TR><TD COLSPAN="3"><DIV CLASS="NAVHEADER"><TABLE BGCOLOR="#CCCCFF" BORDER="0"
CELLPADDING="0" CELLSPACING="0" WIDTH="100%"><TR><TD><TABLE WIDTH="100%" BORDER="0"
CELLPADDING="3" CELLSPACING="0"><TR><TH COLSPAN="3">Smarty Manual</TH></TR><TR><TD
CELLPADDING="3" CELLSPACING="0"><TR><TH COLSPAN="3">Manual do Smarty</TH></TR><TR><TD
COLSPAN="3" ALIGN="center">&nbsp;</TD></TR></TABLE></TD></TR><TR BGCOLOR="#333366">
<TD><IMG SRC="spacer.gif" BORDER="0" WIDTH="1" HEIGHT="1"><BR></TD></TR></TABLE></DIV></TD></TR>
<TR><TD><IMG SRC="spacer.gif" WIDTH="10" HEIGHT="1"></TD><TD HEIGHT="100%" VALIGN="MIDDLE" WIDTH="100%"><BR>