cleaning up a problem when parsing UTF-16 and libiconv is not used. Daniel

* parser.c: cleaning up a problem when parsing UTF-16 and libiconv
  is not used.
Daniel
diff --git a/ChangeLog b/ChangeLog
index 5a8fe6b..36d24d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Aug 11 17:02:23 CEST 2003 Daniel Veillard <daniel@veillard.com>
+
+	* parser.c: cleaning up a problem when parsing UTF-16 and libiconv
+	  is not used.
+
 Sun Aug 10 08:13:22 HKT 2003 William Brack <wbrack@mmm.com.hk>
 
 	* win32/libxml2.def.src: renerated with fixed libxml2-api.xml
diff --git a/parser.c b/parser.c
index 6e44896..1a8ba36 100644
--- a/parser.c
+++ b/parser.c
@@ -7574,6 +7574,16 @@
 	    ctxt->wellFormed = 0;
 	    if (ctxt->recovery == 0) ctxt->disableSAX = 1;
 	}
+	/*
+	 * UTF-16 encoding stwich has already taken place at this stage,
+	 * more over the little-endian/big-endian selection is already done
+	 */
+        if ((encoding != NULL) &&
+	    ((!xmlStrcasecmp(encoding, BAD_CAST "UTF-16")) ||
+	     (!xmlStrcasecmp(encoding, BAD_CAST "UTF16")))) {
+	     xmlFree(encoding);
+	     encoding = NULL;
+	}
 	if (encoding != NULL) {
 	    xmlCharEncodingHandlerPtr handler;