mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-23 22:35:30 +01:00
Fix #2041 (Error fetching news la repubblica on MacOSX)
This commit is contained in:
parent
00bd62d92d
commit
759ca69205
1 changed files with 4 additions and 1 deletions
|
|
@ -1306,7 +1306,10 @@ def handle_charref(self, ref):
|
|||
if self.convertEntities:
|
||||
if ref.lower().startswith('x'): #
|
||||
ref = int(ref[1:], 16) # Added by Kovid to handle hex numeric entities
|
||||
data = unichr(int(ref))
|
||||
try:
|
||||
data = unichr(int(ref))
|
||||
except ValueError: # Bad numerical entity. Added by Kovid
|
||||
data = u''
|
||||
else:
|
||||
data = '&#%s;' % ref
|
||||
self.handle_data(data)
|
||||
|
|
|
|||
Loading…
Reference in a new issue