mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-20 03:52:25 +03:00
fixed some htmlSetMetaEncoding() problems fixup and integrated tests for
* HTMLtree.c: fixed some htmlSetMetaEncoding() problems * python/libxml.c python/tests/Makefile.am python/tests/serialize.py: fixup and integrated tests for the serialization stuff Daniel
This commit is contained in:
@@ -1491,8 +1491,9 @@ libxml_serializeNode(PyObject *self, PyObject *args) {
|
||||
xmlCharEncodingHandlerPtr handler = NULL;
|
||||
|
||||
doc = (xmlDocPtr) node;
|
||||
if (encoding == NULL)
|
||||
encoding = (xmlChar *) htmlGetMetaEncoding(doc);
|
||||
if (encoding != NULL)
|
||||
htmlSetMetaEncoding(doc, encoding);
|
||||
encoding = (xmlChar *) htmlGetMetaEncoding(doc);
|
||||
|
||||
if (encoding != NULL) {
|
||||
handler = xmlFindCharEncodingHandler(encoding);
|
||||
@@ -1564,6 +1565,9 @@ libxml_serializeNode(PyObject *self, PyObject *args) {
|
||||
xmlOutputBufferPtr buf;
|
||||
xmlCharEncodingHandlerPtr handler = NULL;
|
||||
|
||||
if (encoding != NULL)
|
||||
htmlSetMetaEncoding(doc, encoding);
|
||||
encoding = (xmlChar *) htmlGetMetaEncoding(doc);
|
||||
if (encoding != NULL) {
|
||||
handler = xmlFindCharEncodingHandler(encoding);
|
||||
if (handler == NULL) {
|
||||
|
Reference in New Issue
Block a user