Lines Matching refs:encoding
83 const xmlChar *encoding;
135 msg = "unknown encoding %s\n";
200 * encoding specified.
337 if ((ctxt->encoding == NULL) && (ctxt->escape == NULL))
365 if (ctxt->encoding != NULL)
366 xmlFree((char *) ctxt->encoding);
380 xmlNewSaveCtxt(const char *encoding, int options)
391 if (encoding != NULL) {
392 ret->handler = xmlFindCharEncodingHandler(encoding);
394 xmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding);
398 ret->encoding = xmlStrdup((const xmlChar *)encoding);
556 static int xmlSaveSwitchEncoding(xmlSaveCtxtPtr ctxt, const char *encoding) {
559 if ((encoding != NULL) && (buf->encoder == NULL) && (buf->conv == NULL)) {
560 buf->encoder = xmlFindCharEncodingHandler((const char *)encoding);
563 (const char *)encoding);
569 xmlSaveErrMemory("creating encoding buffer");
789 * @encoding: an optional encoding string
843 const xmlChar *oldctxtenc = ctxt->encoding;
844 const xmlChar *encoding = ctxt->encoding;
853 oldenc = doc->encoding;
854 if (ctxt->encoding != NULL) {
855 doc->encoding = BAD_CAST ctxt->encoding;
856 } else if (doc->encoding != NULL) {
857 encoding = doc->encoding;
861 if ((encoding != NULL) && (doc != NULL))
862 htmlSetMetaEncoding(doc, (const xmlChar *) encoding);
863 if ((encoding == NULL) && (doc != NULL))
864 encoding = htmlGetMetaEncoding(doc);
865 if (encoding == NULL)
866 encoding = BAD_CAST "HTML";
867 if ((encoding != NULL) && (oldctxtenc == NULL) &&
869 if (xmlSaveSwitchEncoding(ctxt, (const char*) encoding) < 0) {
870 doc->encoding = oldenc;
877 (const char *)encoding, 1);
880 (const char *)encoding, 0);
888 doc->encoding = oldenc;
1107 const xmlChar *oldenc = cur->encoding;
1108 const xmlChar *oldctxtenc = ctxt->encoding;
1109 const xmlChar *encoding = ctxt->encoding;
1122 if (ctxt->encoding != NULL) {
1123 cur->encoding = BAD_CAST ctxt->encoding;
1124 } else if (cur->encoding != NULL) {
1125 encoding = cur->encoding;
1127 encoding = (const xmlChar *)
1136 if (encoding != NULL)
1137 htmlSetMetaEncoding(cur, (const xmlChar *) encoding);
1138 if (encoding == NULL)
1139 encoding = htmlGetMetaEncoding(cur);
1140 if (encoding == NULL)
1141 encoding = BAD_CAST "HTML";
1142 if ((encoding != NULL) && (oldctxtenc == NULL) &&
1144 if (xmlSaveSwitchEncoding(ctxt, (const char*) encoding) < 0) {
1145 cur->encoding = oldenc;
1151 (const char *)encoding, 1);
1154 (const char *)encoding, 0);
1155 if (ctxt->encoding != NULL)
1156 cur->encoding = oldenc;
1164 enc = xmlParseCharEncoding((const char*) encoding);
1165 if ((encoding != NULL) && (oldctxtenc == NULL) &&
1172 * we need to switch to this encoding but just for this
1176 if (xmlSaveSwitchEncoding(ctxt, (const char*) encoding) < 0) {
1177 cur->encoding = oldenc;
1198 if (encoding != NULL) {
1199 xmlOutputBufferWrite(buf, 10, " encoding=");
1200 xmlBufWriteQuotedString(buf->buffer, (xmlChar *) encoding);
1249 cur->encoding = oldenc;
1413 * @encoding: an optional encoding string
1447 * @encoding: an optional encoding string
1643 if (ctxt->encoding) {
1644 xmlOutputBufferWriteString(buf, (const char *)ctxt->encoding);
1678 if (ctxt->encoding) {
1679 xmlOutputBufferWriteString(buf, (const char *)ctxt->encoding);
1796 * @encoding: the encoding name to use or NULL
1800 * with the encoding and the options given.
1805 xmlSaveToFd(int fd, const char *encoding, int options)
1809 ret = xmlNewSaveCtxt(encoding, options);
1822 * @encoding: the encoding name to use or NULL
1826 * to an URL (but this is less reliable) with the encoding and the options
1832 xmlSaveToFilename(const char *filename, const char *encoding, int options)
1837 ret = xmlNewSaveCtxt(encoding, options);
1851 * @encoding: the encoding name to use or NULL
1855 * with the encoding and the options given
1861 xmlSaveToBuffer(xmlBufferPtr buffer, const char *encoding, int options)
1867 ret = xmlNewSaveCtxt(encoding, options);
1870 if (encoding != NULL) {
1871 handler = xmlFindCharEncodingHandler(encoding);
1894 * @encoding: the encoding name to use or NULL
1898 * with the encoding and the options given
1905 void *ioctx, const char *encoding, int options)
1909 ret = xmlNewSaveCtxt(encoding, options);
2101 (doc->encoding == NULL))) {
2113 doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");
2144 doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");
2347 * @encoding: an optional encoding string
2355 int level, int format, const char *encoding)
2367 if (encoding == NULL)
2368 encoding = "UTF-8";
2375 ctxt.encoding = (const xmlChar *) encoding;
2399 * @txt_encoding: Character encoding to use when generating XML text
2402 * Dump the current DOM tree into memory using the character encoding specified
2436 * Validate the encoding value, if provided.
2441 txt_encoding = (const char *) out_doc->encoding;
2461 ctxt.encoding = (const xmlChar *) txt_encoding;
2522 * @txt_encoding: Character encoding to use when generating XML text
2524 * Dump the current DOM tree into memory using the character encoding specified
2552 const char * encoding;
2563 encoding = (const char *) cur->encoding;
2565 if (encoding != NULL) {
2566 handler = xmlFindCharEncodingHandler(encoding);
2568 xmlFree((char *) cur->encoding);
2569 cur->encoding = NULL;
2570 encoding = NULL;
2580 ctxt.encoding = (const xmlChar *) encoding;
2607 * @encoding: the encoding if any assuming the I/O layer handles the trancoding
2616 xmlSaveFileTo(xmlOutputBufferPtr buf, xmlDocPtr cur, const char *encoding) {
2630 ctxt.encoding = (const xmlChar *) encoding;
2642 * @encoding: the encoding if any assuming the I/O layer handles the trancoding
2653 const char *encoding, int format)
2670 ctxt.encoding = (const xmlChar *) encoding;
2682 * @encoding: the name of the encoding to use or NULL.
2693 const char * encoding, int format ) {
2702 if (encoding == NULL)
2703 encoding = (const char *) cur->encoding;
2705 if (encoding != NULL) {
2707 handler = xmlFindCharEncodingHandler(encoding);
2725 ctxt.encoding = (const xmlChar *) encoding;
2740 * @encoding: the name of an encoding (or NULL)
2742 * Dump an XML document, converting it to the given encoding
2747 xmlSaveFileEnc(const char *filename, xmlDocPtr cur, const char *encoding) {
2748 return ( xmlSaveFormatFileEnc( filename, cur, encoding, 0 ) );