Add XML_SetEncoding

This commit is contained in:
James Clark 1998-11-27 02:24:11 +00:00
parent 13594c689a
commit 845dd4dd8b
2 changed files with 19 additions and 0 deletions

View File

@ -468,6 +468,18 @@ XML_Parser XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep)
return parser;
}
int XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName)
{
if (encodingName)
protocolEncodingName = 0;
else {
protocolEncodingName = poolCopyString(&tempPool, encodingName);
if (!protocolEncodingName)
return 0;
}
return 1;
}
XML_Parser XML_ExternalEntityParserCreate(XML_Parser oldParser,
const XML_Char *context,
const XML_Char *encodingName)

View File

@ -306,6 +306,13 @@ XML_SetUserData(XML_Parser parser, void *userData);
/* Returns the last value set by XML_SetUserData or null. */
#define XML_GetUserData(parser) (*(void **)(parser))
/* This is equivalent to supplying an encoding argument
to XML_CreateParser. It must not be called before XML_Parse
or XML_ParseBuffer. */
int XMLPARSEAPI
XML_SetEncoding(XML_Parser parser, const XML_Char *encoding);
/* If this function is called, then the parser will be passed
as the first argument to callbacks instead of userData.
The userData will still be accessible using XML_GetUserData. */