diff --git a/ebook_converter/__init__.py b/ebook_converter/__init__.py index 0151c81..13f8fae 100644 --- a/ebook_converter/__init__.py +++ b/ebook_converter/__init__.py @@ -107,13 +107,6 @@ def walk(dir): yield os.path.join(record[0], f) -def my_unichr(num): - try: - return chr(num) - except (ValueError, OverflowError): - return '?' - - def entity_to_unicode(match, exceptions=[], encoding='cp1252', result_exceptions={}): """ @@ -134,6 +127,12 @@ def entity_to_unicode(match, exceptions=[], encoding='cp1252', actual entities. """ + def my_unichr(num): + try: + return chr(num) + except (ValueError, OverflowError): + return '?' + def check(ch): return result_exceptions.get(ch, ch)