Ticket #47132: fix_unicode_issues.diff

File fix_unicode_issues.diff, 1.6 KB (added by RJVB (René Bertin), 9 years ago)
  • parsers.py

    old new  
    478478                    itm = VideoItem(cat, it)
    479479                    vids[it['ID']] = itm
    480480
    481         logger.info('category {0} has {1} videos'.format(cat, len(vids)))
     481        logger.info(u'category {0} has {1} videos'.format(cat, len(vids)))
    482482        self.alw.videos[cat] = vids
    483483        self.loadingCategoryFinished.emit(CATEGORIES[self.lang][cat])
    484484
  • ui_main.py

    old new  
    708708
    709709    def enable_button(self, btn):
    710710        for k in self.buttons.keys():
    711             if btn in self.buttons[k]:
     711            if unicode(btn) in unicode(self.buttons[k]):
    712712                k.setEnabled(True)
    713713
    714714    def set_page_button_style(self):
     
    718718
    719719    def set_toggled_button(self, cat):
    720720        for k in self.buttons.keys():
    721             if cat in self.buttons[k]:
     721            if unicode(cat) in unicode(self.buttons[k]):
    722722                k.set_current(True)
    723723            else:
    724724                k.set_current(False)
  • artePlus.py

    old new  
    658658            except:
    659659                pass
    660660
    661         summary = self.videos[idx].summary.decode('utf-8', 'replace')
     661        try:
     662            summary = self.videos[idx].summary.decode('utf-8', 'replace')
     663        except:
     664            summary = self.videos[idx].summary
    662665        font = QtGui.QFont("sans", 10)
    663666        c_form = QtGui.QTextCharFormat()
    664667        c_form.setFont(font)