Lines Matching defs:encoding
41 #include <libxml/encoding.h>
219 * running with UTF-8 encoding.
227 * Clean macros, not dependent of an ASCII context, expect UTF-8 encoding
298 * If the encoding is unspecified, in the case we find an ISO-Latin-1
299 * char, then the encoding converter is plugged in automatically.
316 * From rfc2044: encoding of the Unicode values on UTF-8:
378 * Assume it's a fixed length encoding (1) with
379 * a compatible encoding for the ASCII set, since
396 * input encoding didn't get properly advertized in the
397 * declaration header. Report the error and switch the encoding
399 * encoding !)
412 "Input is not proper UTF-8, indicate encoding !\n",
2139 cur->encoding = NULL;
3286 * the encoding
3287 * If a new encoding is detected the parser is switched to decode
3292 const xmlChar *encoding;
3297 /* do not change encoding */
3298 if (ctxt->input->encoding != NULL)
3301 encoding = xmlStrcasestr(attvalue, BAD_CAST"charset=");
3302 if (encoding != NULL) {
3303 encoding += 8;
3305 encoding = xmlStrcasestr(attvalue, BAD_CAST"charset =");
3306 if (encoding != NULL)
3307 encoding += 9;
3309 if (encoding != NULL) {
3313 while ((*encoding == ' ') || (*encoding == '\t')) encoding++;
3315 if (ctxt->input->encoding != NULL)
3316 xmlFree((xmlChar *) ctxt->input->encoding);
3317 ctxt->input->encoding = xmlStrdup(encoding);
3319 enc = xmlParseCharEncoding((const char *) encoding);
3331 "htmlCheckEncoding: wrong encoding meta\n",
3341 handler = xmlFindCharEncodingHandler((const char *) encoding);
4249 ctxt->encoding = NULL;
4398 * @encoding: a free form C string describing the HTML document encoding, or NULL
4402 * TODO: check the need to add encoding handling there
4407 htmlCreateDocParserCtxt(const xmlChar *cur, const char *encoding) {
4418 if (encoding != NULL) {
4422 if (ctxt->input->encoding != NULL)
4423 xmlFree((xmlChar *) ctxt->input->encoding);
4424 ctxt->input->encoding = xmlStrdup((const xmlChar *) encoding);
4426 enc = xmlParseCharEncoding(encoding);
4434 "Unsupported encoding %s\n",
4435 (const xmlChar *) encoding, NULL);
4441 handler = xmlFindCharEncodingHandler((const char *) encoding);
4446 "Unsupported encoding %s\n",
4447 (const xmlChar *) encoding, NULL);
5378 * @enc: an optional encoding
5469 * @encoding: a free form C string describing the HTML document encoding, or NULL
5482 htmlSAXParseDoc(xmlChar *cur, const char *encoding, htmlSAXHandlerPtr sax, void *userData) {
5491 ctxt = htmlCreateDocParserCtxt(cur, encoding);
5513 * @encoding: a free form C string describing the HTML document encoding, or NULL
5521 htmlParseDoc(xmlChar *cur, const char *encoding) {
5522 return(htmlSAXParseDoc(cur, encoding, NULL, NULL));
5529 * @encoding: a free form C string describing the HTML document encoding, or NULL
5538 htmlCreateFileParserCtxt(const char *filename, const char *encoding)
5573 /* set encoding */
5574 if (encoding) {
5575 content = xmlMallocAtomic (xmlStrlen(content_line) + strlen(encoding) + 1);
5578 strcat ((char *)content, (char *)encoding);
5590 * @encoding: a free form C string describing the HTML document encoding, or NULL
5604 htmlSAXParseFile(const char *filename, const char *encoding, htmlSAXHandlerPtr sax,
5612 ctxt = htmlCreateFileParserCtxt(filename, encoding);
5635 * @encoding: a free form C string describing the HTML document encoding, or NULL
5644 htmlParseFile(const char *filename, const char *encoding) {
5645 return(htmlSAXParseFile(filename, encoding, NULL, NULL));
5835 DICT_FREE(ctxt->encoding);
5836 ctxt->encoding = NULL;
5940 * @encoding: the document encoding, or NULL
5949 htmlDoRead(htmlParserCtxtPtr ctxt, const char *URL, const char *encoding,
5956 if (encoding != NULL) {
5959 hdlr = xmlFindCharEncodingHandler(encoding);
5983 * @encoding: the document encoding, or NULL
5991 htmlReadDoc(const xmlChar * cur, const char *URL, const char *encoding, int options)
6002 return (htmlDoRead(ctxt, URL, encoding, options, 0));
6008 * @encoding: the document encoding, or NULL
6016 htmlReadFile(const char *filename, const char *encoding, int options)
6021 ctxt = htmlCreateFileParserCtxt(filename, encoding);
6032 * @encoding: the document encoding, or NULL
6040 htmlReadMemory(const char *buffer, int size, const char *URL, const char *encoding, int options)
6051 return (htmlDoRead(ctxt, URL, encoding, options, 0));
6058 * @encoding: the document encoding, or NULL
6066 htmlReadFd(int fd, const char *URL, const char *encoding, int options)
6091 return (htmlDoRead(ctxt, URL, encoding, options, 0));
6100 * @encoding: the document encoding, or NULL
6109 void *ioctx, const char *URL, const char *encoding, int options)
6135 return (htmlDoRead(ctxt, URL, encoding, options, 0));
6143 * @encoding: the document encoding, or NULL
6153 const char *URL, const char *encoding, int options)
6169 return (htmlDoRead(ctxt, URL, encoding, options, 1));
6176 * @encoding: the document encoding, or NULL
6186 const char *encoding, int options)
6202 return (htmlDoRead(ctxt, NULL, encoding, options, 1));
6211 * @encoding: the document encoding, or NULL
6221 const char *URL, const char *encoding, int options)
6245 return (htmlDoRead(ctxt, URL, encoding, options, 1));
6253 * @encoding: the document encoding, or NULL
6263 const char *URL, const char *encoding, int options)
6285 return (htmlDoRead(ctxt, URL, encoding, options, 1));
6295 * @encoding: the document encoding, or NULL
6307 const char *encoding, int options)
6329 return (htmlDoRead(ctxt, URL, encoding, options, 1));