Ticket #1526: eithelper-utf8-handling.diff

File eithelper-utf8-handling.diff, 1.6 KB (added by Stuart Auchterlonie, 15 years ago)

Patch to fix problem

  • libs/libmythtv/eithelper.cpp

    old new  
    243243        VERBOSE(VB_EIT, QString("New: %1 %2 %3: %4")
    244244                .arg(event.StartTime.toString(timeFmtDB2))
    245245                .arg(event.EndTime.toString(timeFmtDB2))
    246                 .arg(event.Event_Name)
    247                 .arg(event.Event_Subtitle));
     246                .arg(event.Event_Name.utf8())
     247                .arg(event.Event_Subtitle.utf8()));
    248248
    249249        // Delete the old program row
    250250        delq.bindValue(":CHANID",    chanid);
     
    285285        return true; // return true on error
    286286
    287287    QString dbDescription = query.value(1).toString();
    288     if (event.Description.length() > dbDescription.length())
     288    if (event.Description.utf8().length() > dbDescription.length())
    289289    {
    290290        VERBOSE(VB_EIT, "EITHelper: Update DB description " +
    291291                QString("oldsize=%1 newsize=%2")
     
    294294        return false; // description needs to be updated
    295295    }
    296296
    297     QString eSubtitle = event.Event_Subtitle.lower();
     297    QString eSubtitle = event.Event_Subtitle.utf8().lower();
    298298    if (eSubtitle.isEmpty())
    299299        return query.size(); // assume subtitle would be the same
    300300
    301301    QString dbSubtitle = query.value(0).toString().lower();
    302302
     303    if (dbSubtitle != eSubtitle)
     304        VERBOSE(VB_EIT, "EITHelper: Subtitles are different");
    303305    return dbSubtitle == eSubtitle; // return true on match...
    304306}
    305307