1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-03-30 17:03:31 +02:00

Removed polyglot codepoint_to_chr

This commit is contained in:
2020-04-20 19:29:05 +02:00
parent 128705f258
commit eac0b98d6f
11 changed files with 20 additions and 25 deletions

View File

@@ -9,7 +9,7 @@ import urllib.parse
from ebook_converter import relpath, guess_type, prints, force_unicode
from ebook_converter.utils.config_base import tweaks
from ebook_converter.polyglot.builtins import codepoint_to_chr, getcwd, iteritems, itervalues, as_unicode
from ebook_converter.polyglot.builtins import getcwd, iteritems, itervalues, as_unicode
from ebook_converter.polyglot.urllib import unquote
@@ -157,7 +157,7 @@ def get_title_sort_pat(lang=None):
return ans
_ignore_starts = '\'"'+''.join(codepoint_to_chr(x) for x in
_ignore_starts = '\'"'+''.join(chr(x) for x in
list(range(0x2018, 0x201e))+[0x2032, 0x2033])

View File

@@ -6,7 +6,7 @@ import re
from ebook_converter import force_unicode
from ebook_converter.ebooks.metadata import MetaInformation
from ebook_converter.polyglot.builtins import codepoint_to_chr, string_or_bytes, int_to_byte
from ebook_converter.polyglot.builtins import string_or_bytes, int_to_byte
title_pat = re.compile(br'\{\\info.*?\{\\title(.*?)(?<!\\)\}', re.DOTALL)
author_pat = re.compile(br'\{\\info.*?\{\\author(.*?)(?<!\\)\}', re.DOTALL)
@@ -90,7 +90,7 @@ def decode(raw, codec):
def uni(match):
try:
return codepoint_to_chr(int(match.group(1)))
return chr(int(match.group(1)))
except Exception:
return '?'