mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-04-24 23:31:29 +02:00
Removed safe_chr function
This commit is contained in:
@@ -18,7 +18,6 @@ from ebook_converter.constants_old import islinux, isfrozen, \
|
|||||||
isbsd, __appname__, __version__, __author__, \
|
isbsd, __appname__, __version__, __author__, \
|
||||||
config_dir
|
config_dir
|
||||||
from ebook_converter.startup import winutil, winutilerror
|
from ebook_converter.startup import winutil, winutilerror
|
||||||
from ebook_converter.utils.icu import safe_chr
|
|
||||||
|
|
||||||
|
|
||||||
if False:
|
if False:
|
||||||
@@ -231,7 +230,7 @@ def walk(dir):
|
|||||||
|
|
||||||
def my_unichr(num):
|
def my_unichr(num):
|
||||||
try:
|
try:
|
||||||
return safe_chr(num)
|
return chr(num)
|
||||||
except (ValueError, OverflowError):
|
except (ValueError, OverflowError):
|
||||||
return '?'
|
return '?'
|
||||||
|
|
||||||
|
|||||||
@@ -3,15 +3,11 @@ from collections import OrderedDict
|
|||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from ebook_converter.utils.icu import safe_chr, ord_string
|
from ebook_converter.utils.icu import ord_string
|
||||||
from ebook_converter.utils.fonts.sfnt.container import Sfnt
|
from ebook_converter.utils.fonts.sfnt.container import Sfnt
|
||||||
from ebook_converter.utils.fonts.sfnt.errors import UnsupportedFont, NoGlyphs
|
from ebook_converter.utils.fonts.sfnt.errors import UnsupportedFont, NoGlyphs
|
||||||
|
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
|
|
||||||
__docformat__ = 'restructuredtext en'
|
|
||||||
|
|
||||||
# TrueType outlines {{{
|
# TrueType outlines {{{
|
||||||
|
|
||||||
|
|
||||||
@@ -253,7 +249,7 @@ def main(args):
|
|||||||
def conv_code(c):
|
def conv_code(c):
|
||||||
if c.upper()[:2] in ('U+', '0X'):
|
if c.upper()[:2] in ('U+', '0X'):
|
||||||
c = int(c[2:], 16)
|
c = int(c[2:], 16)
|
||||||
return safe_chr(int(c))
|
return chr(int(c))
|
||||||
|
|
||||||
for c in chars:
|
for c in chars:
|
||||||
if '-' in c:
|
if '-' in c:
|
||||||
|
|||||||
Reference in New Issue
Block a user