version 1.86, 2000/12/06 14:30:34
|
version 1.87, 2000/12/18 12:51:37
|
Line 2791 htmlCheckEncoding(htmlParserCtxtPtr ctxt
|
Line 2791 htmlCheckEncoding(htmlParserCtxtPtr ctxt
|
if ((ctxt == NULL) || (attvalue == NULL)) |
if ((ctxt == NULL) || (attvalue == NULL)) |
return; |
return; |
|
|
|
/* do not change encoding */ |
|
if (ctxt->input->encoding != NULL) |
|
return; |
|
|
encoding = xmlStrcasestr(attvalue, BAD_CAST"charset="); |
encoding = xmlStrcasestr(attvalue, BAD_CAST"charset="); |
if (encoding != NULL) { |
if (encoding != NULL) { |
encoding += 8; |
encoding += 8; |
Line 4826 htmlCreateFileParserCtxt(const char *fil
|
Line 4830 htmlCreateFileParserCtxt(const char *fil
|
htmlParserInputPtr inputStream; |
htmlParserInputPtr inputStream; |
xmlParserInputBufferPtr buf; |
xmlParserInputBufferPtr buf; |
/* htmlCharEncoding enc; */ |
/* htmlCharEncoding enc; */ |
|
xmlChar *content, *content_line = (xmlChar *) "charset="; |
|
|
buf = xmlParserInputBufferCreateFilename(filename, XML_CHAR_ENCODING_NONE); |
buf = xmlParserInputBufferCreateFilename(filename, XML_CHAR_ENCODING_NONE); |
if (buf == NULL) return(NULL); |
if (buf == NULL) return(NULL); |
Line 4856 htmlCreateFileParserCtxt(const char *fil
|
Line 4861 htmlCreateFileParserCtxt(const char *fil
|
inputStream->free = NULL; |
inputStream->free = NULL; |
|
|
inputPush(ctxt, inputStream); |
inputPush(ctxt, inputStream); |
|
|
|
/* set encoding */ |
|
if (encoding) { |
|
content = xmlMalloc (xmlStrlen(content_line) + strlen(encoding) + 1); |
|
if (content) { |
|
strcpy ((char *)content, (char *)content_line); |
|
strcat ((char *)content, (char *)encoding); |
|
htmlCheckEncoding (ctxt, content); |
|
xmlFree (content); |
|
} |
|
} |
|
|
return(ctxt); |
return(ctxt); |
} |
} |
|
|