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

Function xmlSwitchInputEncodingName

ThirdParty/libxml2/vtklibxml2/parserInternals.c:1109–1129  ·  view source on GitHub ↗

* xmlSwitchEncodingName: * @ctxt: the parser context, only for error reporting * @input: the input strea, * @encoding: the encoding name * * Available since 2.13.0. * * Returns 0 in case of success, -1 otherwise */

Source from the content-addressed store, hash-verified

1107 * Returns 0 in case of success, -1 otherwise
1108 */
1109static int
1110xmlSwitchInputEncodingName(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
1111 const char *encoding) {
1112 xmlCharEncodingHandlerPtr handler;
1113 int res;
1114
1115 if (encoding == NULL)
1116 return(-1);
1117
1118 res = xmlOpenCharEncodingHandler(encoding, /* output */ 0, &handler);
1119 if (res == XML_ERR_UNSUPPORTED_ENCODING) {
1120 xmlWarningMsg(ctxt, XML_ERR_UNSUPPORTED_ENCODING,
1121 "Unsupported encoding: %s\n", BAD_CAST encoding, NULL);
1122 return(-1);
1123 } else if (res != XML_ERR_OK) {
1124 xmlFatalErr(ctxt, res, encoding);
1125 return(-1);
1126 }
1127
1128 return(xmlSwitchInputEncoding(ctxt, input, handler));
1129}
1130
1131/**
1132 * xmlSwitchEncodingName:

Callers 3

xmlSwitchEncodingNameFunction · 0.85
xmlNewInputURLFunction · 0.85
xmlNewInputInternalFunction · 0.85

Calls 3

xmlFatalErrFunction · 0.85
xmlSwitchInputEncodingFunction · 0.85

Tested by

no test coverage detected