Home | History | Annotate | Download | only in libxml2

Lines Matching refs: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;
3294 * the encoding
3295 * If a new encoding is detected the parser is switched to decode
3300 const xmlChar *encoding;
3305 /* do not change encoding */
3306 if (ctxt->input->encoding != NULL)
3309 encoding = xmlStrcasestr(attvalue, BAD_CAST"charset=");
3310 if (encoding != NULL) {
3311 encoding += 8;
3313 encoding = xmlStrcasestr(attvalue, BAD_CAST"charset =");
3314 if (encoding != NULL)
3315 encoding += 9;
3317 if (encoding != NULL) {
3321 while ((*encoding == ' ') || (*encoding == '\t')) encoding++;
3323 if (ctxt->input->encoding != NULL)
3324 xmlFree((xmlChar *) ctxt->input->encoding);
3325 ctxt->input->encoding = xmlStrdup(encoding);
3327 enc = xmlParseCharEncoding((const char *) encoding);
3339 "htmlCheckEncoding: wrong encoding meta\n",
3349 handler = xmlFindCharEncodingHandler((const char *) encoding);
4144 if ((ctxt->encoding == (const xmlChar *)XML_CHAR_ENCODING_NONE) &&
4149 * plug some encoding conversion routines.
4291 ctxt->encoding = NULL;
4440 * @encoding: a free form C string describing the HTML document encoding, or NULL
4444 * TODO: check the need to add encoding handling there
4449 htmlCreateDocParserCtxt(const xmlChar *cur, const char *encoding) {
4460 if (encoding != NULL) {
4464 if (ctxt->input->encoding != NULL)
4465 xmlFree((xmlChar *) ctxt->input->encoding);
4466 ctxt->input->encoding = xmlStrdup((const xmlChar *) encoding);
4468 enc = xmlParseCharEncoding(encoding);
4476 "Unsupported encoding %s\n",
4477 (const xmlChar *) encoding, NULL);
4483 handler = xmlFindCharEncodingHandler((const char *) encoding);
4488 "Unsupported encoding %s\n",
4489 (const xmlChar *) encoding, NULL);
5420 * @enc: an optional encoding
5511 * @encoding: a free form C string describing the HTML document encoding, or NULL
5524 htmlSAXParseDoc(xmlChar *cur, const char *encoding, htmlSAXHandlerPtr sax, void *userData) {
5533 ctxt = htmlCreateDocParserCtxt(cur, encoding);
5555 * @encoding: a free form C string describing the HTML document encoding, or NULL
5563 htmlParseDoc(xmlChar *cur, const char *encoding) {
5564 return(htmlSAXParseDoc(cur, encoding, NULL, NULL));
5571 * @encoding: a free form C string describing the HTML document encoding, or NULL
5580 htmlCreateFileParserCtxt(const char *filename, const char *encoding)
5615 /* set encoding */
5616 if (encoding) {
5617 content = xmlMallocAtomic (xmlStrlen(content_line) + strlen(encoding) + 1);
5620 strcat ((char *)content, (char *)encoding);
5632 * @encoding: a free form C string describing the HTML document encoding, or NULL
5646 htmlSAXParseFile(const char *filename, const char *encoding, htmlSAXHandlerPtr sax,
5654 ctxt = htmlCreateFileParserCtxt(filename, encoding);
5677 * @encoding: a free form C string describing the HTML document encoding, or NULL
5686 htmlParseFile(const char *filename, const char *encoding) {
5687 return(htmlSAXParseFile(filename, encoding, NULL, NULL));
5877 DICT_FREE(ctxt->encoding);
5878 ctxt->encoding = NULL;
5982 * @encoding: the document encoding, or NULL
5991 htmlDoRead(htmlParserCtxtPtr ctxt, const char *URL, const char *encoding,
5998 if (encoding != NULL) {
6001 hdlr = xmlFindCharEncodingHandler(encoding);
6004 if (ctxt->input->encoding != NULL)
6005 xmlFree((xmlChar *) ctxt->input->encoding);
6006 ctxt->input->encoding = xmlStrdup((xmlChar *)encoding);
6029 * @encoding: the document encoding, or NULL
6037 htmlReadDoc(const xmlChar * cur, const char *URL, const char *encoding, int options)
6048 return (htmlDoRead(ctxt, URL, encoding, options, 0));
6054 * @encoding: the document encoding, or NULL
6062 htmlReadFile(const char *filename, const char *encoding, int options)
6067 ctxt = htmlCreateFileParserCtxt(filename, encoding);
6078 * @encoding: the document encoding, or NULL
6086 htmlReadMemory(const char *buffer, int size, const char *URL, const char *encoding, int options)
6097 return (htmlDoRead(ctxt, URL, encoding, options, 0));
6104 * @encoding: the document encoding, or NULL
6112 htmlReadFd(int fd, const char *URL, const char *encoding, int options)
6137 return (htmlDoRead(ctxt, URL, encoding, options, 0));
6146 * @encoding: the document encoding, or NULL
6155 void *ioctx, const char *URL, const char *encoding, int options)
6181 return (htmlDoRead(ctxt, URL, encoding, options, 0));
6189 * @encoding: the document encoding, or NULL
6199 const char *URL, const char *encoding, int options)
6215 return (htmlDoRead(ctxt, URL, encoding, options, 1));
6222 * @encoding: the document encoding, or NULL
6232 const char *encoding, int options)
6248 return (htmlDoRead(ctxt, NULL, encoding, options, 1));
6257 * @encoding: the document encoding, or NULL
6267 const char *URL, const char *encoding, int options)
6291 return (htmlDoRead(ctxt, URL, encoding, options, 1));
6299 * @encoding: the document encoding, or NULL
6309 const char *URL, const char *encoding, int options)
6331 return (htmlDoRead(ctxt, URL, encoding, options, 1));
6341 * @encoding: the document encoding, or NULL
6353 const char *encoding, int options)
6375 return (htmlDoRead(ctxt, URL, encoding, options, 1));