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

Function xmlGetEncodingAlias

ThirdParty/libxml2/vtklibxml2/encoding.c:951–977  ·  view source on GitHub ↗

* xmlGetEncodingAlias: * @alias: the alias name as parsed, in UTF-8 format (ASCII actually) * * Lookup an encoding name for the given alias. * * Returns NULL if not found, otherwise the original name */

Source from the content-addressed store, hash-verified

949 * Returns NULL if not found, otherwise the original name
950 */
951const char *
952xmlGetEncodingAlias(const char *alias) {
953 int i;
954 char upper[100];
955
956 if (alias == NULL)
957 return(NULL);
958
959 if (xmlCharEncodingAliases == NULL)
960 return(NULL);
961
962 for (i = 0;i < 99;i++) {
963 upper[i] = (char) toupper((unsigned char) alias[i]);
964 if (upper[i] == 0) break;
965 }
966 upper[i] = 0;
967
968 /*
969 * Walk down the list looking for a definition of the alias
970 */
971 for (i = 0;i < xmlCharEncodingAliasesNb;i++) {
972 if (!strcmp(xmlCharEncodingAliases[i].alias, upper)) {
973 return(xmlCharEncodingAliases[i].name);
974 }
975 }
976 return(NULL);
977}
978
979/**
980 * xmlAddEncodingAlias:

Callers 3

xmlParseCharEncodingFunction · 0.85

Calls 1

toupperFunction · 0.85

Tested by

no test coverage detected