mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Conversion: Convert entities that reference non-BMP unicode codepoints on Windows and OS X correctly. Linux was not affected by this bug. Fixes #1417327 [incorrect assignment code of symbol](https://bugs.launchpad.net/calibre/+bug/1417327)
This commit is contained in:
parent
4618304369
commit
29f4e41fba
@ -19,6 +19,7 @@ from calibre.constants import (iswindows, isosx, islinux, isfrozen,
|
|||||||
win32event, win32api, winerror, fcntl,
|
win32event, win32api, winerror, fcntl,
|
||||||
filesystem_encoding, plugins, config_dir)
|
filesystem_encoding, plugins, config_dir)
|
||||||
from calibre.startup import winutil, winutilerror
|
from calibre.startup import winutil, winutilerror
|
||||||
|
from calibre.utils.icu import safe_chr
|
||||||
|
|
||||||
if False and islinux and not getattr(sys, 'frozen', False):
|
if False and islinux and not getattr(sys, 'frozen', False):
|
||||||
# Imported before PyQt to workaround PyQt util-linux conflict discovered on gentoo
|
# Imported before PyQt to workaround PyQt util-linux conflict discovered on gentoo
|
||||||
@ -533,7 +534,7 @@ def strftime(fmt, t=None):
|
|||||||
|
|
||||||
def my_unichr(num):
|
def my_unichr(num):
|
||||||
try:
|
try:
|
||||||
return unichr(num)
|
return safe_chr(num)
|
||||||
except (ValueError, OverflowError):
|
except (ValueError, OverflowError):
|
||||||
return u'?'
|
return u'?'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user