version 1.1.1.1, 2012/02/21 23:37:58
|
version 1.1.1.2, 2013/07/22 01:22:20
|
Line 151 found_content:
|
Line 151 found_content:
|
* htmlSetMetaEncoding: |
* htmlSetMetaEncoding: |
* @doc: the document |
* @doc: the document |
* @encoding: the encoding string |
* @encoding: the encoding string |
* | * |
* Sets the current encoding in the Meta tags |
* Sets the current encoding in the Meta tags |
* NOTE: this will not change the document content encoding, just |
* NOTE: this will not change the document content encoding, just |
* the META flag associated. |
* the META flag associated. |
Line 164 htmlSetMetaEncoding(htmlDocPtr doc, const xmlChar *enc
|
Line 164 htmlSetMetaEncoding(htmlDocPtr doc, const xmlChar *enc
|
const xmlChar *content = NULL; |
const xmlChar *content = NULL; |
char newcontent[100]; |
char newcontent[100]; |
|
|
|
newcontent[0] = 0; |
|
|
if (doc == NULL) |
if (doc == NULL) |
return(-1); |
return(-1); |
Line 244 found_meta:
|
Line 245 found_meta:
|
http = 1; |
http = 1; |
else |
else |
{ |
{ |
if ((value != NULL) && | if ((value != NULL) && |
(!xmlStrcasecmp(attr->name, BAD_CAST"content"))) |
(!xmlStrcasecmp(attr->name, BAD_CAST"content"))) |
content = value; |
content = value; |
} |
} |
Line 278 create:
|
Line 279 create:
|
xmlNewProp(meta, BAD_CAST"content", BAD_CAST newcontent); |
xmlNewProp(meta, BAD_CAST"content", BAD_CAST newcontent); |
} |
} |
} else { |
} else { |
|
/* remove the meta tag if NULL is passed */ |
|
if (encoding == NULL) { |
|
xmlUnlinkNode(meta); |
|
xmlFreeNode(meta); |
|
} |
/* change the document only if there is a real encoding change */ |
/* change the document only if there is a real encoding change */ |
if (xmlStrcasestr(content, encoding) == NULL) { | else if (xmlStrcasestr(content, encoding) == NULL) { |
xmlSetProp(meta, BAD_CAST"content", BAD_CAST newcontent); |
xmlSetProp(meta, BAD_CAST"content", BAD_CAST newcontent); |
} |
} |
} |
} |
Line 481 htmlNodeDumpFileFormat(FILE *out, xmlDocPtr doc,
|
Line 487 htmlNodeDumpFileFormat(FILE *out, xmlDocPtr doc,
|
if (enc != XML_CHAR_ENCODING_UTF8) { |
if (enc != XML_CHAR_ENCODING_UTF8) { |
handler = xmlFindCharEncodingHandler(encoding); |
handler = xmlFindCharEncodingHandler(encoding); |
if (handler == NULL) |
if (handler == NULL) |
return(-1); | htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); |
} |
} |
} |
} |
|
|
Line 562 htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, i
|
Line 568 htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, i
|
} |
} |
|
|
handler = xmlFindCharEncodingHandler(encoding); |
handler = xmlFindCharEncodingHandler(encoding); |
if (handler == NULL) { | if (handler == NULL) |
*mem = NULL; | htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); |
*size = 0; | |
return; | |
} | |
} else { |
} else { |
handler = xmlFindCharEncodingHandler(encoding); |
handler = xmlFindCharEncodingHandler(encoding); |
} |
} |
Line 587 htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, i
|
Line 591 htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, i
|
return; |
return; |
} |
} |
|
|
htmlDocContentDumpFormatOutput(buf, cur, NULL, format); | htmlDocContentDumpFormatOutput(buf, cur, NULL, format); |
|
|
xmlOutputBufferFlush(buf); |
xmlOutputBufferFlush(buf); |
if (buf->conv != NULL) { |
if (buf->conv != NULL) { |
Line 1061 htmlDocDump(FILE *f, xmlDocPtr cur) {
|
Line 1065 htmlDocDump(FILE *f, xmlDocPtr cur) {
|
|
|
handler = xmlFindCharEncodingHandler(encoding); |
handler = xmlFindCharEncodingHandler(encoding); |
if (handler == NULL) |
if (handler == NULL) |
return(-1); | htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); |
} else { |
} else { |
handler = xmlFindCharEncodingHandler(encoding); |
handler = xmlFindCharEncodingHandler(encoding); |
} |
} |
Line 1120 htmlSaveFile(const char *filename, xmlDocPtr cur) {
|
Line 1124 htmlSaveFile(const char *filename, xmlDocPtr cur) {
|
|
|
handler = xmlFindCharEncodingHandler(encoding); |
handler = xmlFindCharEncodingHandler(encoding); |
if (handler == NULL) |
if (handler == NULL) |
return(-1); | htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); |
} |
} |
} |
} |
|
|
Line 1181 htmlSaveFileFormat(const char *filename, xmlDocPtr cur
|
Line 1185 htmlSaveFileFormat(const char *filename, xmlDocPtr cur
|
|
|
handler = xmlFindCharEncodingHandler(encoding); |
handler = xmlFindCharEncodingHandler(encoding); |
if (handler == NULL) |
if (handler == NULL) |
return(-1); | htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); |
} |
} |
htmlSetMetaEncoding(cur, (const xmlChar *) encoding); |
htmlSetMetaEncoding(cur, (const xmlChar *) encoding); |
} else { |
} else { |