https://bugzilla.wikimedia.org/show_bug.cgi?id=54572
--- Comment #2 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- output should be fixed in output method. Would you please check the following fix in output method:
def output(...) ... try: text = unicode(text, 'utf-8') except UnicodeDecodeError: text = unicode(text, 'iso8859-1')
replace it with
try: text = unicode(text, 'utf-8') except UnicodeDecodeError: text = unicode(text, locale.getpreferredencoding())