1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-03-12 20:45:47 +01: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

@@ -15,7 +15,6 @@ import os, re
from ebook_converter.ebooks.rtf2xml import copy
from ebook_converter.utils.mreplace import MReplace
from ebook_converter.ptempfile import better_mktemp
from ebook_converter.polyglot.builtins import codepoint_to_chr
from . import open_for_read, open_for_write
@@ -95,7 +94,7 @@ class Tokenize:
uni_len = len(match_obj.group(0))
if uni_char < 0:
uni_char += 65536
uni_char = codepoint_to_chr(uni_char).encode('ascii', 'xmlcharrefreplace').decode('ascii')
uni_char = chr(uni_char).encode('ascii', 'xmlcharrefreplace').decode('ascii')
self.__uc_char = self.__uc_value[-1]
# there is only an unicode char
if len(token)<= uni_len: