Re: [xslt] Set xmlDoc encoding type
- From: Alexwell Sandro <alexwellll gmail com>
- To: xslt gnome org
- Subject: Re: [xslt] Set xmlDoc encoding type
- Date: Fri, 13 Sep 2013 10:09:11 -0300
I found a way to save to buffer with encoding:
xmlDocPtr xmlDoc = xmlNewDoc(BAD_CAST("1.0"));
// xmlDocSetRootElement(xmlDoc, (xmlNodePtr)node);
xmlBufferPtr buffer = xmlBufferCreate();
xmlCharEncodingHandlerPtr encodingHandler = xmlFindCharEncodingHandler("UTF-8");
xmlOutputBufferPtr buf = xmlOutputBufferCreateBuffer(buffer, encodingHandler);
int ret = xmlSaveFormatFileTo(buf, xmlDoc, "UTF-8", 0);
// xmlBufferContent(buffer);
// xmlBufferLength(buffer);
xmlBufferFree(buffer);
xmlFreeDoc(xmlDoc);
I'm using Windows OS, Is this the best way to save to buffer with encoding?
[Date Prev][Date Next] [Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]