diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2003-08-14 12:19:54 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2003-08-14 12:19:54 +0000 |
commit | ab1ae3a7685fb7891ef8f6540a0612170300b151 (patch) | |
tree | d5d0c5e6ac02b1c0a962e695605008740f465d51 /parser.c | |
parent | ccf996fca0d0a22d56b8fdd63551dd14ebeb360f (diff) | |
download | android_external_libxml2-ab1ae3a7685fb7891ef8f6540a0612170300b151.tar.gz android_external_libxml2-ab1ae3a7685fb7891ef8f6540a0612170300b151.tar.bz2 android_external_libxml2-ab1ae3a7685fb7891ef8f6540a0612170300b151.zip |
applied UTF-16 encoding handling patch provided by Mark Itzcovitz more
* encoding.c: applied UTF-16 encoding handling patch provided by
Mark Itzcovitz
* encoding.c parser.c: more cleanup and fixes for UTF-16 when
not having iconv support.
Daniel
Diffstat (limited to 'parser.c')
-rw-r--r-- | parser.c | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -7518,7 +7518,7 @@ xmlParseEncName(xmlParserCtxtPtr ctxt) { * Returns the encoding value or NULL */ -xmlChar * +const xmlChar * xmlParseEncodingDecl(xmlParserCtxtPtr ctxt) { xmlChar *encoding = NULL; const xmlChar *q; @@ -7582,23 +7582,21 @@ xmlParseEncodingDecl(xmlParserCtxtPtr ctxt) { if ((encoding != NULL) && ((!xmlStrcasecmp(encoding, BAD_CAST "UTF-16")) || (!xmlStrcasecmp(encoding, BAD_CAST "UTF16")))) { - if (ctxt->input->encoding != NULL) - xmlFree((xmlChar *) ctxt->input->encoding); - ctxt->input->encoding = encoding; - encoding = NULL; + if (ctxt->encoding != NULL) + xmlFree((xmlChar *) ctxt->encoding); + ctxt->encoding = encoding; } /* * UTF-8 encoding is handled natively */ - if ((encoding != NULL) && + else if ((encoding != NULL) && ((!xmlStrcasecmp(encoding, BAD_CAST "UTF-8")) || (!xmlStrcasecmp(encoding, BAD_CAST "UTF8")))) { - if (ctxt->input->encoding != NULL) - xmlFree((xmlChar *) ctxt->input->encoding); - ctxt->input->encoding = encoding; - encoding = NULL; + if (ctxt->encoding != NULL) + xmlFree((xmlChar *) ctxt->encoding); + ctxt->encoding = encoding; } - if (encoding != NULL) { + else if (encoding != NULL) { xmlCharEncodingHandlerPtr handler; if (ctxt->input->encoding != NULL) |