mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 02:13:47 +02:00
Fix #7328 (Why are Unicode strings with encoding declaration not supported.)
This commit is contained in:
parent
371db2af99
commit
c1dc4ad09d
1 changed files with 2 additions and 2 deletions
|
|
@ -30,9 +30,9 @@ def detect(aBuf):
|
|||
|
||||
# Added by Kovid
|
||||
ENCODING_PATS = [
|
||||
re.compile(r'<\?[^<>]+encoding=[\'"](.*?)[\'"][^<>]*>',
|
||||
re.compile(r'<\?[^<>]+encoding\s*=\s*[\'"](.*?)[\'"][^<>]*>',
|
||||
re.IGNORECASE),
|
||||
re.compile(r'''<meta\s+?[^<>]+?content=['"][^'"]*?charset=([-a-z0-9]+)[^'"]*?['"][^<>]*>''',
|
||||
re.compile(r'''<meta\s+?[^<>]+?content\s*=\s*['"][^'"]*?charset=([-a-z0-9]+)[^'"]*?['"][^<>]*>''',
|
||||
re.IGNORECASE)
|
||||
]
|
||||
ENTITY_PATTERN = re.compile(r'&(\S+?);')
|
||||
|
|
|
|||
Loading…
Reference in a new issue