0

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()

Jam12345
  • 133
  • 1
  • 1
  • 7
  • 1
    Can you give any more details? Which characters are we talking about? How do they appear in the XML file? How are they being misdisplayed? Which software is misdisplaying them? What OS is this running under, and with what display environment? If under Unix or Linux, what are your locale settings? – Steve Summit Jul 10 '19 at 11:50
  • @SteveSummit characters like 'áéíóúñü' they are displayed with another in correct capitalised spanish character (not correct), I'm using a linux OS – Jam12345 Jul 10 '19 at 12:05
  • One possibility is that the environment variables `LANG` or `LC_ALL` need to be set correctly, probably to a UTF-8 variant, possibly to an es_ variant. Running the `locale` command at the command prompt might tell you something, too. – Steve Summit Jul 10 '19 at 14:31
  • @SteveSummit what would u suggest LC_ALL to be set to? The rest of these varaibles are set to "en_GB.UTF-8" – Jam12345 Jul 10 '19 at 14:44
  • If the rest are all set to something with UTF-8 in them then LC_ALL is not needed, and this is probably not your problem after all. Sorry for the false alarm. – Steve Summit Jul 10 '19 at 15:21
  • We're probably going to need to see some sample input and output, and probably some code. – Steve Summit Jul 10 '19 at 15:22
  • @SteveSummit no worries give me a couple mins – Jam12345 Jul 10 '19 at 15:22

0 Answers0