mirror of
https://github.com/GNOME/libxml2.git
synced 2025-05-08 21:07:54 +08:00
encoding: Deprecate xmlCharEncodingHandler members
This commit is contained in:
parent
b34dc1e4a3
commit
3b4a84e4b7
@ -29,7 +29,6 @@ void testXmlwriterFilename(const char *uri);
|
|||||||
void testXmlwriterMemory(void);
|
void testXmlwriterMemory(void);
|
||||||
void testXmlwriterDoc(void);
|
void testXmlwriterDoc(void);
|
||||||
void testXmlwriterTree(void);
|
void testXmlwriterTree(void);
|
||||||
xmlChar *ConvertInput(const char *in, const char *encoding);
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
@ -68,7 +67,6 @@ testXmlwriterFilename(const char *uri)
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
xmlTextWriterPtr writer;
|
xmlTextWriterPtr writer;
|
||||||
xmlChar *tmp;
|
|
||||||
|
|
||||||
/* Create a new XmlWriter for uri, with no compression. */
|
/* Create a new XmlWriter for uri, with no compression. */
|
||||||
writer = xmlNewTextWriterFilename(uri, 0);
|
writer = xmlNewTextWriterFilename(uri, 0);
|
||||||
@ -96,19 +94,12 @@ testXmlwriterFilename(const char *uri)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write a comment as child of EXAMPLE.
|
rc = xmlTextWriterWriteComment(writer, BAD_CAST "This is a comment");
|
||||||
* Please observe, that the input to the xmlTextWriter functions
|
|
||||||
* HAS to be in UTF-8, even if the output XML is encoded
|
|
||||||
* in iso-8859-1 */
|
|
||||||
tmp = ConvertInput("This is a comment with special chars: <\xE4\xF6\xFC>",
|
|
||||||
MY_ENCODING);
|
|
||||||
rc = xmlTextWriterWriteComment(writer, tmp);
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
printf
|
printf
|
||||||
("testXmlwriterFilename: Error at xmlTextWriterWriteComment\n");
|
("testXmlwriterFilename: Error at xmlTextWriterWriteComment\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tmp != NULL) xmlFree(tmp);
|
|
||||||
|
|
||||||
/* Start an element named "ORDER" as child of EXAMPLE. */
|
/* Start an element named "ORDER" as child of EXAMPLE. */
|
||||||
rc = xmlTextWriterStartElement(writer, BAD_CAST "ORDER");
|
rc = xmlTextWriterStartElement(writer, BAD_CAST "ORDER");
|
||||||
@ -137,16 +128,12 @@ testXmlwriterFilename(const char *uri)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Write a comment as child of ORDER */
|
/* Write a comment as child of ORDER */
|
||||||
tmp = ConvertInput("<\xE4\xF6\xFC>", MY_ENCODING);
|
rc = xmlTextWriterWriteComment(writer, BAD_CAST "This is another comment");
|
||||||
rc = xmlTextWriterWriteFormatComment(writer,
|
|
||||||
"This is another comment with special chars: %s",
|
|
||||||
tmp);
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
printf
|
printf
|
||||||
("testXmlwriterFilename: Error at xmlTextWriterWriteFormatComment\n");
|
("testXmlwriterFilename: Error at xmlTextWriterWriteFormatComment\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tmp != NULL) xmlFree(tmp);
|
|
||||||
|
|
||||||
/* Start an element named "HEADER" as child of ORDER. */
|
/* Start an element named "HEADER" as child of ORDER. */
|
||||||
rc = xmlTextWriterStartElement(writer, BAD_CAST "HEADER");
|
rc = xmlTextWriterStartElement(writer, BAD_CAST "HEADER");
|
||||||
@ -175,24 +162,22 @@ testXmlwriterFilename(const char *uri)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Write an element named "NAME_1" as child of HEADER. */
|
/* Write an element named "NAME_1" as child of HEADER. */
|
||||||
tmp = ConvertInput("M\xFCller", MY_ENCODING);
|
rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1",
|
||||||
rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1", tmp);
|
BAD_CAST "Mueller");
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
printf
|
printf
|
||||||
("testXmlwriterFilename: Error at xmlTextWriterWriteElement\n");
|
("testXmlwriterFilename: Error at xmlTextWriterWriteElement\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tmp != NULL) xmlFree(tmp);
|
|
||||||
|
|
||||||
/* Write an element named "NAME_2" as child of HEADER. */
|
/* Write an element named "NAME_2" as child of HEADER. */
|
||||||
tmp = ConvertInput("J\xF6rg", MY_ENCODING);
|
rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2",
|
||||||
rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2", tmp);
|
BAD_CAST "Joerg");
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
printf
|
printf
|
||||||
("testXmlwriterFilename: Error at xmlTextWriterWriteElement\n");
|
("testXmlwriterFilename: Error at xmlTextWriterWriteElement\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tmp != NULL) xmlFree(tmp);
|
|
||||||
|
|
||||||
/* Close the element named HEADER. */
|
/* Close the element named HEADER. */
|
||||||
rc = xmlTextWriterEndElement(writer);
|
rc = xmlTextWriterEndElement(writer);
|
||||||
@ -337,7 +322,6 @@ testXmlwriterMemory(void)
|
|||||||
int rc;
|
int rc;
|
||||||
xmlTextWriterPtr writer;
|
xmlTextWriterPtr writer;
|
||||||
xmlBufferPtr buf;
|
xmlBufferPtr buf;
|
||||||
xmlChar *tmp;
|
|
||||||
|
|
||||||
/* Create a new XML buffer, to which the XML document will be
|
/* Create a new XML buffer, to which the XML document will be
|
||||||
* written */
|
* written */
|
||||||
@ -374,19 +358,13 @@ testXmlwriterMemory(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write a comment as child of EXAMPLE.
|
/* Write a comment as child of EXAMPLE. */
|
||||||
* Please observe, that the input to the xmlTextWriter functions
|
rc = xmlTextWriterWriteComment(writer, BAD_CAST "This is a comment");
|
||||||
* HAS to be in UTF-8, even if the output XML is encoded
|
|
||||||
* in iso-8859-1 */
|
|
||||||
tmp = ConvertInput("This is a comment with special chars: <\xE4\xF6\xFC>",
|
|
||||||
MY_ENCODING);
|
|
||||||
rc = xmlTextWriterWriteComment(writer, tmp);
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
printf
|
printf
|
||||||
("testXmlwriterMemory: Error at xmlTextWriterWriteComment\n");
|
("testXmlwriterMemory: Error at xmlTextWriterWriteComment\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tmp != NULL) xmlFree(tmp);
|
|
||||||
|
|
||||||
/* Start an element named "ORDER" as child of EXAMPLE. */
|
/* Start an element named "ORDER" as child of EXAMPLE. */
|
||||||
rc = xmlTextWriterStartElement(writer, BAD_CAST "ORDER");
|
rc = xmlTextWriterStartElement(writer, BAD_CAST "ORDER");
|
||||||
@ -415,16 +393,12 @@ testXmlwriterMemory(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Write a comment as child of ORDER */
|
/* Write a comment as child of ORDER */
|
||||||
tmp = ConvertInput("<\xE4\xF6\xFC>", MY_ENCODING);
|
rc = xmlTextWriterWriteComment(writer, BAD_CAST "This is another comment");
|
||||||
rc = xmlTextWriterWriteFormatComment(writer,
|
|
||||||
"This is another comment with special chars: %s",
|
|
||||||
tmp);
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
printf
|
printf
|
||||||
("testXmlwriterMemory: Error at xmlTextWriterWriteFormatComment\n");
|
("testXmlwriterMemory: Error at xmlTextWriterWriteFormatComment\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tmp != NULL) xmlFree(tmp);
|
|
||||||
|
|
||||||
/* Start an element named "HEADER" as child of ORDER. */
|
/* Start an element named "HEADER" as child of ORDER. */
|
||||||
rc = xmlTextWriterStartElement(writer, BAD_CAST "HEADER");
|
rc = xmlTextWriterStartElement(writer, BAD_CAST "HEADER");
|
||||||
@ -453,25 +427,23 @@ testXmlwriterMemory(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Write an element named "NAME_1" as child of HEADER. */
|
/* Write an element named "NAME_1" as child of HEADER. */
|
||||||
tmp = ConvertInput("M\xFCller", MY_ENCODING);
|
rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1",
|
||||||
rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1", tmp);
|
BAD_CAST "Mueller");
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
printf
|
printf
|
||||||
("testXmlwriterMemory: Error at xmlTextWriterWriteElement\n");
|
("testXmlwriterMemory: Error at xmlTextWriterWriteElement\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tmp != NULL) xmlFree(tmp);
|
|
||||||
|
|
||||||
/* Write an element named "NAME_2" as child of HEADER. */
|
/* Write an element named "NAME_2" as child of HEADER. */
|
||||||
tmp = ConvertInput("J\xF6rg", MY_ENCODING);
|
rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2",
|
||||||
rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2", tmp);
|
BAD_CAST "Joerg");
|
||||||
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
printf
|
printf
|
||||||
("testXmlwriterMemory: Error at xmlTextWriterWriteElement\n");
|
("testXmlwriterMemory: Error at xmlTextWriterWriteElement\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tmp != NULL) xmlFree(tmp);
|
|
||||||
|
|
||||||
/* Close the element named HEADER. */
|
/* Close the element named HEADER. */
|
||||||
rc = xmlTextWriterEndElement(writer);
|
rc = xmlTextWriterEndElement(writer);
|
||||||
@ -611,7 +583,6 @@ testXmlwriterDoc(void)
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
xmlTextWriterPtr writer;
|
xmlTextWriterPtr writer;
|
||||||
xmlChar *tmp;
|
|
||||||
xmlDocPtr doc;
|
xmlDocPtr doc;
|
||||||
|
|
||||||
|
|
||||||
@ -639,18 +610,12 @@ testXmlwriterDoc(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write a comment as child of EXAMPLE.
|
/* Write a comment as child of EXAMPLE. */
|
||||||
* Please observe, that the input to the xmlTextWriter functions
|
rc = xmlTextWriterWriteComment(writer, BAD_CAST "This is a comment");
|
||||||
* HAS to be in UTF-8, even if the output XML is encoded
|
|
||||||
* in iso-8859-1 */
|
|
||||||
tmp = ConvertInput("This is a comment with special chars: <\xE4\xF6\xFC>",
|
|
||||||
MY_ENCODING);
|
|
||||||
rc = xmlTextWriterWriteComment(writer, tmp);
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
printf("testXmlwriterDoc: Error at xmlTextWriterWriteComment\n");
|
printf("testXmlwriterDoc: Error at xmlTextWriterWriteComment\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tmp != NULL) xmlFree(tmp);
|
|
||||||
|
|
||||||
/* Start an element named "ORDER" as child of EXAMPLE. */
|
/* Start an element named "ORDER" as child of EXAMPLE. */
|
||||||
rc = xmlTextWriterStartElement(writer, BAD_CAST "ORDER");
|
rc = xmlTextWriterStartElement(writer, BAD_CAST "ORDER");
|
||||||
@ -676,16 +641,12 @@ testXmlwriterDoc(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Write a comment as child of ORDER */
|
/* Write a comment as child of ORDER */
|
||||||
tmp = ConvertInput("<\xE4\xF6\xFC>", MY_ENCODING);
|
rc = xmlTextWriterWriteComment(writer, BAD_CAST "This is another comment");
|
||||||
rc = xmlTextWriterWriteFormatComment(writer,
|
|
||||||
"This is another comment with special chars: %s",
|
|
||||||
tmp);
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
printf
|
printf
|
||||||
("testXmlwriterDoc: Error at xmlTextWriterWriteFormatComment\n");
|
("testXmlwriterDoc: Error at xmlTextWriterWriteFormatComment\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tmp != NULL) xmlFree(tmp);
|
|
||||||
|
|
||||||
/* Start an element named "HEADER" as child of ORDER. */
|
/* Start an element named "HEADER" as child of ORDER. */
|
||||||
rc = xmlTextWriterStartElement(writer, BAD_CAST "HEADER");
|
rc = xmlTextWriterStartElement(writer, BAD_CAST "HEADER");
|
||||||
@ -713,22 +674,20 @@ testXmlwriterDoc(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Write an element named "NAME_1" as child of HEADER. */
|
/* Write an element named "NAME_1" as child of HEADER. */
|
||||||
tmp = ConvertInput("M\xFCller", MY_ENCODING);
|
rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1",
|
||||||
rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1", tmp);
|
BAD_CAST "Mueller");
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
printf("testXmlwriterDoc: Error at xmlTextWriterWriteElement\n");
|
printf("testXmlwriterDoc: Error at xmlTextWriterWriteElement\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tmp != NULL) xmlFree(tmp);
|
|
||||||
|
|
||||||
/* Write an element named "NAME_2" as child of HEADER. */
|
/* Write an element named "NAME_2" as child of HEADER. */
|
||||||
tmp = ConvertInput("J\xF6rg", MY_ENCODING);
|
rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2",
|
||||||
rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2", tmp);
|
BAD_CAST "Joerg");
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
printf("testXmlwriterDoc: Error at xmlTextWriterWriteElement\n");
|
printf("testXmlwriterDoc: Error at xmlTextWriterWriteElement\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tmp != NULL) xmlFree(tmp);
|
|
||||||
|
|
||||||
/* Close the element named HEADER. */
|
/* Close the element named HEADER. */
|
||||||
rc = xmlTextWriterEndElement(writer);
|
rc = xmlTextWriterEndElement(writer);
|
||||||
@ -863,7 +822,6 @@ testXmlwriterTree(void)
|
|||||||
xmlTextWriterPtr writer;
|
xmlTextWriterPtr writer;
|
||||||
xmlDocPtr doc;
|
xmlDocPtr doc;
|
||||||
xmlNodePtr node;
|
xmlNodePtr node;
|
||||||
xmlChar *tmp;
|
|
||||||
|
|
||||||
/* Create a new XML DOM tree, to which the XML document will be
|
/* Create a new XML DOM tree, to which the XML document will be
|
||||||
* written */
|
* written */
|
||||||
@ -901,18 +859,12 @@ testXmlwriterTree(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write a comment as child of EXAMPLE.
|
/* Write a comment as child of EXAMPLE. */
|
||||||
* Please observe, that the input to the xmlTextWriter functions
|
rc = xmlTextWriterWriteComment(writer, BAD_CAST "This is a comment");
|
||||||
* HAS to be in UTF-8, even if the output XML is encoded
|
|
||||||
* in iso-8859-1 */
|
|
||||||
tmp = ConvertInput("This is a comment with special chars: <\xE4\xF6\xFC>",
|
|
||||||
MY_ENCODING);
|
|
||||||
rc = xmlTextWriterWriteComment(writer, tmp);
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
printf("testXmlwriterTree: Error at xmlTextWriterWriteComment\n");
|
printf("testXmlwriterTree: Error at xmlTextWriterWriteComment\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tmp != NULL) xmlFree(tmp);
|
|
||||||
|
|
||||||
/* Start an element named "ORDER" as child of EXAMPLE. */
|
/* Start an element named "ORDER" as child of EXAMPLE. */
|
||||||
rc = xmlTextWriterStartElement(writer, BAD_CAST "ORDER");
|
rc = xmlTextWriterStartElement(writer, BAD_CAST "ORDER");
|
||||||
@ -940,16 +892,12 @@ testXmlwriterTree(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Write a comment as child of ORDER */
|
/* Write a comment as child of ORDER */
|
||||||
tmp = ConvertInput("<\xE4\xF6\xFC>", MY_ENCODING);
|
rc = xmlTextWriterWriteComment(writer, BAD_CAST "This is another comment");
|
||||||
rc = xmlTextWriterWriteFormatComment(writer,
|
|
||||||
"This is another comment with special chars: %s",
|
|
||||||
tmp);
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
printf
|
printf
|
||||||
("testXmlwriterTree: Error at xmlTextWriterWriteFormatComment\n");
|
("testXmlwriterTree: Error at xmlTextWriterWriteFormatComment\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tmp != NULL) xmlFree(tmp);
|
|
||||||
|
|
||||||
/* Start an element named "HEADER" as child of ORDER. */
|
/* Start an element named "HEADER" as child of ORDER. */
|
||||||
rc = xmlTextWriterStartElement(writer, BAD_CAST "HEADER");
|
rc = xmlTextWriterStartElement(writer, BAD_CAST "HEADER");
|
||||||
@ -977,22 +925,20 @@ testXmlwriterTree(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Write an element named "NAME_1" as child of HEADER. */
|
/* Write an element named "NAME_1" as child of HEADER. */
|
||||||
tmp = ConvertInput("M\xFCller", MY_ENCODING);
|
rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1",
|
||||||
rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1", tmp);
|
BAD_CAST "Mueller");
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
printf("testXmlwriterTree: Error at xmlTextWriterWriteElement\n");
|
printf("testXmlwriterTree: Error at xmlTextWriterWriteElement\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tmp != NULL) xmlFree(tmp);
|
|
||||||
|
|
||||||
/* Write an element named "NAME_2" as child of HEADER. */
|
/* Write an element named "NAME_2" as child of HEADER. */
|
||||||
tmp = ConvertInput("J\xF6rg", MY_ENCODING);
|
rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2",
|
||||||
rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2", tmp);
|
BAD_CAST "Joerg");
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
printf("testXmlwriterTree: Error at xmlTextWriterWriteElement\n");
|
printf("testXmlwriterTree: Error at xmlTextWriterWriteElement\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tmp != NULL) xmlFree(tmp);
|
|
||||||
|
|
||||||
/* Close the element named HEADER. */
|
/* Close the element named HEADER. */
|
||||||
rc = xmlTextWriterEndElement(writer);
|
rc = xmlTextWriterEndElement(writer);
|
||||||
@ -1114,65 +1060,6 @@ testXmlwriterTree(void)
|
|||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ConvertInput:
|
|
||||||
* @in: string in a given encoding
|
|
||||||
* @encoding: the encoding used
|
|
||||||
*
|
|
||||||
* Converts @in into UTF-8 for processing with libxml2 APIs
|
|
||||||
*
|
|
||||||
* Returns the converted UTF-8 string, or NULL in case of error.
|
|
||||||
*/
|
|
||||||
xmlChar *
|
|
||||||
ConvertInput(const char *in, const char *encoding)
|
|
||||||
{
|
|
||||||
xmlChar *out;
|
|
||||||
int ret;
|
|
||||||
int size;
|
|
||||||
int out_size;
|
|
||||||
int temp;
|
|
||||||
xmlCharEncodingHandlerPtr handler;
|
|
||||||
|
|
||||||
if (in == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
handler = xmlFindCharEncodingHandler(encoding);
|
|
||||||
|
|
||||||
if (!handler) {
|
|
||||||
printf("ConvertInput: no encoding handler found for '%s'\n",
|
|
||||||
encoding ? encoding : "");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
size = (int) strlen(in) + 1;
|
|
||||||
out_size = size * 2 - 1;
|
|
||||||
out = (unsigned char *) xmlMalloc((size_t) out_size);
|
|
||||||
|
|
||||||
if (out != 0) {
|
|
||||||
temp = size - 1;
|
|
||||||
ret = handler->input(out, &out_size, (const xmlChar *) in, &temp);
|
|
||||||
if ((ret < 0) || (temp - size + 1)) {
|
|
||||||
if (ret < 0) {
|
|
||||||
printf("ConvertInput: conversion wasn't successful.\n");
|
|
||||||
} else {
|
|
||||||
printf
|
|
||||||
("ConvertInput: conversion wasn't successful. converted: %i octets.\n",
|
|
||||||
temp);
|
|
||||||
}
|
|
||||||
|
|
||||||
xmlFree(out);
|
|
||||||
out = 0;
|
|
||||||
} else {
|
|
||||||
out = (unsigned char *) xmlRealloc(out, out_size + 1);
|
|
||||||
out[out_size] = 0; /*null terminating out */
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
printf("ConvertInput: no mem\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
int main(void) {
|
int main(void) {
|
||||||
fprintf(stderr, "Writer or output support not compiled in\n");
|
fprintf(stderr, "Writer or output support not compiled in\n");
|
||||||
|
@ -139,15 +139,15 @@ typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler;
|
|||||||
typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr;
|
typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr;
|
||||||
struct _xmlCharEncodingHandler {
|
struct _xmlCharEncodingHandler {
|
||||||
char *name;
|
char *name;
|
||||||
xmlCharEncodingInputFunc input;
|
xmlCharEncodingInputFunc input XML_DEPRECATED_MEMBER;
|
||||||
xmlCharEncodingOutputFunc output;
|
xmlCharEncodingOutputFunc output XML_DEPRECATED_MEMBER;
|
||||||
#ifdef LIBXML_ICONV_ENABLED
|
#ifdef LIBXML_ICONV_ENABLED
|
||||||
iconv_t iconv_in;
|
iconv_t iconv_in XML_DEPRECATED_MEMBER;
|
||||||
iconv_t iconv_out;
|
iconv_t iconv_out XML_DEPRECATED_MEMBER;
|
||||||
#endif /* LIBXML_ICONV_ENABLED */
|
#endif /* LIBXML_ICONV_ENABLED */
|
||||||
#ifdef LIBXML_ICU_ENABLED
|
#ifdef LIBXML_ICU_ENABLED
|
||||||
struct _uconv_t *uconv_in;
|
struct _uconv_t *uconv_in XML_DEPRECATED_MEMBER;
|
||||||
struct _uconv_t *uconv_out;
|
struct _uconv_t *uconv_out XML_DEPRECATED_MEMBER;
|
||||||
#endif /* LIBXML_ICU_ENABLED */
|
#endif /* LIBXML_ICU_ENABLED */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user