diff options
Diffstat (limited to 'src/raptor_rdfxml.c')
-rw-r--r-- | src/raptor_rdfxml.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/raptor_rdfxml.c b/src/raptor_rdfxml.c index dba6f7ba..9189c02b 100644 --- a/src/raptor_rdfxml.c +++ b/src/raptor_rdfxml.c @@ -732,7 +732,24 @@ raptor_xml_start_element_handler(void *user_data, raptor_parser_fatal_error(rdf_parser, "Out of memory"); return; } - strcpy((char*)xml_language, (char*)atts[i+1]); + + if(rdf_parser->feature_normalize_language) { + char *from=(char*)atts[i+1]; + char *to=xml_language; + + /* Normalize language to lowercase + * http://www.w3.org/TR/rdf-concepts/#dfn-language-identifier + */ + while(*from) { + if(isupper(*from)) + *to++ =tolower(*from++); + else + *to++ =*from++; + } + *to='\0'; + } else + strcpy((char*)xml_language, (char*)atts[i+1]); + atts[i]=NULL; continue; } |