mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 11:14:02 +02:00
Fix bug in regex to extract charset from <meta> tags
This commit is contained in:
parent
43103496ab
commit
5f6ff5609d
1 changed files with 1 additions and 1 deletions
|
|
@ -32,7 +32,7 @@ def detect(aBuf):
|
|||
ENCODING_PATS = [
|
||||
re.compile(r'<\?[^<>]+encoding\s*=\s*[\'"](.*?)[\'"][^<>]*>',
|
||||
re.IGNORECASE),
|
||||
re.compile(r'''<meta\s+?[^<>]+?content\s*=\s*['"][^'"]*?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