MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlGetActualEncoding

Function xmlGetActualEncoding

ThirdParty/libxml2/vtklibxml2/parserInternals.c:1471–1486  ·  view source on GitHub ↗

* xmlGetActualEncoding: * @ctxt: the parser context * * Returns the actual used to parse the document. This can differ from * the declared encoding. */

Source from the content-addressed store, hash-verified

1469 * the declared encoding.
1470 */
1471const xmlChar *
1472xmlGetActualEncoding(xmlParserCtxtPtr ctxt) {
1473 const xmlChar *encoding = NULL;
1474
1475 if ((ctxt->input->flags & XML_INPUT_USES_ENC_DECL) ||
1476 (ctxt->input->flags & XML_INPUT_AUTO_ENCODING)) {
1477 /* Preserve encoding exactly */
1478 encoding = ctxt->encoding;
1479 } else if ((ctxt->input->buf) && (ctxt->input->buf->encoder)) {
1480 encoding = BAD_CAST ctxt->input->buf->encoder->name;
1481 } else if (ctxt->input->flags & XML_INPUT_HAS_ENCODING) {
1482 encoding = BAD_CAST "UTF-8";
1483 }
1484
1485 return(encoding);
1486}
1487
1488/************************************************************************
1489 * *

Callers 2

xmlSAX2EndDocumentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected