XMLTV spanish characters not appearing correctly

旧城冷巷雨未停 提交于 2019-12-11 15:54:01

问题


I have been working with XMLTV and I have found that Spanish characters are not appearing in the EPG correctly, I believe this will be an issue with the xml encoding but I have tested this with both:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8" ?>

And I am still having issues with Spanish characters, any suggestions?

Update:

I am reading in an xml file and converting it to XMLTV, everything works correctly as expected apart from the spanish characters.

void parseStory( xmlDocPtr doc, xmlNodePtr cur, char szFilename[256] ) {

tvNode        = xmlNewTextChild( cur, NULL, "tv", NULL);
channelNode   = xmlNewTextChild( tvNode, NULL, "channel", NULL );
progTitle = xmlNewTextChild( programmeNode, NULL, "title", title );
xmlNewProp( progTitle, "lang", "es" );

displayName = xmlNewTextChild( channelNode, NULL, "display-name", key );
xmlNewProp( channelNode, "id", key );
xmlFree( key );

xmlDocSetRootElement( doc, tvNode );

//Saving (overwriting) file after changes
//xmlSaveFormatFile( (const xmlChar *) szFilename, doc, 1 );
int count;
count = xmlSaveFormatFileEnc( (const xmlChar *) szFilename, doc, "UTF-8", 1 );
syslog( LOG_INFO, "File: %s", szFilename );
syslog( LOG_INFO, "Count: %d", count );

}

This is just a snippet and won't make perfect sense without all but the areas I think affect the spanish characters are the lang props and xmlSaveFormatFileEnc()

来源:https://stackoverflow.com/questions/56967822/xmltv-spanish-characters-not-appearing-correctly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!