1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

applied a couple of patches from Mark Itzcovitz to handle saving back

* tree.c: applied a couple of patches from Mark Itzcovitz
  to handle saving back "UTF-16" documents.
Daniel
This commit is contained in:
Daniel Veillard 2003-06-05 09:32:20 +00:00
parent a84c0b30c4
commit e13261148b
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Thu Jun 5 11:31:02 CEST 2003 Daniel Veillard <daniel@veillard.com>
* tree.c: applied a couple of patches from Mark Itzcovitz
to handle saving back "UTF-16" documents.
Mon Jun 2 21:56:15 MVT 2003 Daniel Veillard <daniel@veillard.com>
* relaxng.c xmlschemas.c include/libxml/schemasInternals.h: commiting

8
tree.c
View File

@ -7865,7 +7865,9 @@ xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc, xmlChar **doc_txt_ptr,
return;
} else if (doc_charset != XML_CHAR_ENCODING_UTF8) {
conv_hdlr = xmlFindCharEncodingHandler(txt_encoding);
conv_hdlr = xmlGetCharEncodingHandler(doc_charset);
if (conv_hdlr == NULL)
conv_hdlr = xmlFindCharEncodingHandler(txt_encoding);
if ( conv_hdlr == NULL ) {
xmlGenericError(xmlGenericErrorContext,
"%s: %s %s '%s'\n",
@ -8050,7 +8052,9 @@ xmlDocFormatDump(FILE *f, xmlDocPtr cur, int format) {
return(-1);
}
if (enc != XML_CHAR_ENCODING_UTF8) {
handler = xmlFindCharEncodingHandler(encoding);
handler = xmlGetCharEncodingHandler(enc);
if (handler == NULL)
handler = xmlFindCharEncodingHandler(encoding);
if (handler == NULL) {
xmlFree((char *) cur->encoding);
cur->encoding = NULL;