mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-28 00:21:53 +03:00
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
This commit is contained in:
20
parser.c
20
parser.c
@ -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)
|
||||
|
Reference in New Issue
Block a user