Lines Matching defs:encoding
55 #include <libxml/encoding.h>
279 const char *encoding);
503 errmsg = "Invalid XML encoding name";
1985 * running with UTF-8 encoding.
1994 * Clean macros, not dependent of an ASCII context, expect UTF-8 encoding
2000 * to the number of xmlChars used for the encoding [0-5].
2669 * plug some encoding conversion routines.
2671 * encoding (like UTF16, bug 135229), the 'length'
7030 const xmlChar *encoding;
7063 * We must have the encoding declaration
7065 encoding = xmlParseEncodingDecl(ctxt);
7072 if ((encoding == NULL) && (ctxt->errNo == XML_ERR_OK)) {
7074 "Missing encoding in text declaration\n");
7109 if ((ctxt->encoding == NULL) &&
10369 * parse the XML encoding name
10373 * Returns the encoding name value or NULL
10431 * parse the XML encoding declaration
10433 * [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'")
10437 * Returns the encoding value or NULL
10442 xmlChar *encoding = NULL;
10456 encoding = xmlParseEncName(ctxt);
10459 xmlFree((xmlChar *) encoding);
10465 encoding = xmlParseEncName(ctxt);
10468 xmlFree((xmlChar *) encoding);
10477 * Non standard parsing, allowing the user to ignore encoding
10480 xmlFree((xmlChar *) encoding);
10485 * UTF-16 encoding stwich has already taken place at this stage,
10488 if ((encoding != NULL) &&
10489 ((!xmlStrcasecmp(encoding, BAD_CAST "UTF-16")) ||
10490 (!xmlStrcasecmp(encoding, BAD_CAST "UTF16")))) {
10492 * If no encoding was passed to the parser, that we are
10495 * encoding mismatch fatal error
10497 if ((ctxt->encoding == NULL) &&
10503 if (ctxt->encoding != NULL)
10504 xmlFree((xmlChar *) ctxt->encoding);
10505 ctxt->encoding = encoding;
10508 * UTF-8 encoding is handled natively
10510 else if ((encoding != NULL) &&
10511 ((!xmlStrcasecmp(encoding, BAD_CAST "UTF-8")) ||
10512 (!xmlStrcasecmp(encoding, BAD_CAST "UTF8")))) {
10513 if (ctxt->encoding != NULL)
10514 xmlFree((xmlChar *) ctxt->encoding);
10515 ctxt->encoding = encoding;
10517 else if (encoding != NULL) {
10520 if (ctxt->input->encoding != NULL)
10521 xmlFree((xmlChar *) ctxt->input->encoding);
10522 ctxt->input->encoding = encoding;
10524 handler = xmlFindCharEncodingHandler((const char *) encoding);
10533 "Unsupported encoding %s\n", encoding);
10538 return(encoding);
10689 * We may have the encoding declaration
10710 if ((ctxt->input->encoding != NULL) && (!IS_BLANK_CH(RAW))) {
10804 if ((ctxt->encoding == NULL) &&
10809 * plug some encoding conversion routines.
10831 * too small to hold "<?xml version="1.0" encoding="foo"
10839 * Note that we will switch encoding on the fly.
10995 * plug some encoding conversion routines.
11020 * Note that we will switch encoding on the fly.
11271 } else /* unknown encoding */
11376 * encoding="..." may not have been read and we work on a
11377 * guessed encoding.
11415 * plug some encoding conversion routines,
11474 if ((ctxt->encoding == NULL) &&
11475 (ctxt->input->encoding != NULL))
11476 ctxt->encoding = xmlStrdup(ctxt->input->encoding);
12275 "Input is not proper UTF-8, indicate encoding !\n%s",
12373 * Specific handling if we autodetected an encoding, we should not
12374 * push more than the first line ... which depend on the encoding
12375 * And only push the rest once the final encoding was detected
12536 * the encoding. The remaining characters will be parsed so they
12538 * To allow content encoding detection, @size should be >= 4
12554 * plug some encoding conversion routines
12626 * the encoding, we set the context to XML_CHAR_ENCODING_NONE so
12699 * @enc: the charset encoding if known
12769 * @enc: the charset encoding if known
12821 * plug some encoding conversion routines here.
12857 * plug some encoding conversion routines.
12962 * plug some encoding conversion routines here.
13139 * plug some encoding conversion routines.
13367 * plug some encoding conversion routines.
13811 if (doc->encoding != NULL) {
13814 if (ctxt->encoding != NULL)
13815 xmlFree((xmlChar *) ctxt->encoding);
13816 ctxt->encoding = xmlStrdup((const xmlChar *) doc->encoding);
13818 hdlr = xmlFindCharEncodingHandler((const char *) doc->encoding);
15040 DICT_FREE(ctxt->encoding);
15041 ctxt->encoding = NULL;
15105 * @encoding: the document encoding, or NULL
15113 int size, const char *filename, const char *encoding)
15122 if ((encoding == NULL) && (chunk != NULL) && (size >= 4))
15181 if (encoding != NULL) {
15184 if (ctxt->encoding != NULL)
15185 xmlFree((xmlChar *) ctxt->encoding);
15186 ctxt->encoding = xmlStrdup((const xmlChar *) encoding);
15188 hdlr = xmlFindCharEncodingHandler(encoding);
15193 "Unsupported encoding %s\n", BAD_CAST encoding);
15207 * @encoding: the user provided encoding to use
15215 xmlCtxtUseOptionsInternal(xmlParserCtxtPtr ctxt, int options, const char *encoding)
15219 if (encoding != NULL) {
15220 if (ctxt->encoding != NULL)
15221 xmlFree((xmlChar *) ctxt->encoding);
15222 ctxt->encoding = xmlStrdup((const xmlChar *) encoding);
15365 * @encoding: the document encoding, or NULL
15374 xmlDoRead(xmlParserCtxtPtr ctxt, const char *URL, const char *encoding,
15379 xmlCtxtUseOptionsInternal(ctxt, options, encoding);
15380 if (encoding != NULL) {
15383 hdlr = xmlFindCharEncodingHandler(encoding);
15411 * @encoding: the document encoding, or NULL
15419 xmlReadDoc(const xmlChar * cur, const char *URL, const char *encoding, int options)
15430 return (xmlDoRead(ctxt, URL, encoding, options, 0));
15436 * @encoding: the document encoding, or NULL
15444 xmlReadFile(const char *filename, const char *encoding, int options)
15452 return (xmlDoRead(ctxt, NULL, encoding, options, 0));
15460 * @encoding: the document encoding, or NULL
15468 xmlReadMemory(const char *buffer, int size, const char *URL, const char *encoding, int options)
15476 return (xmlDoRead(ctxt, URL, encoding, options, 0));
15483 * @encoding: the document encoding, or NULL
15493 xmlReadFd(int fd, const char *URL, const char *encoding, int options)
15519 return (xmlDoRead(ctxt, URL, encoding, options, 0));
15528 * @encoding: the document encoding, or NULL
15537 void *ioctx, const char *URL, const char *encoding, int options)
15566 return (xmlDoRead(ctxt, URL, encoding, options, 0));
15574 * @encoding: the document encoding, or NULL
15584 const char *URL, const char *encoding, int options)
15601 return (xmlDoRead(ctxt, URL, encoding, options, 1));
15608 * @encoding: the document encoding, or NULL
15618 const char *encoding, int options)
15635 return (xmlDoRead(ctxt, NULL, encoding, options, 1));
15644 * @encoding: the document encoding, or NULL
15654 const char *URL, const char *encoding, int options)
15679 return (xmlDoRead(ctxt, URL, encoding, options, 1));
15687 * @encoding: the document encoding, or NULL
15699 const char *URL, const char *encoding, int options)
15723 return (xmlDoRead(ctxt, URL, encoding, options, 1));
15733 * @encoding: the document encoding, or NULL
15745 const char *encoding, int options)
15771 return (xmlDoRead(ctxt, URL, encoding, options, 1));