mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Improve encoding detection.
This commit is contained in:
parent
2ad3dcda4d
commit
1f710c1fd2
@ -1812,7 +1812,7 @@ class UnicodeDammit:
|
||||
('^<\?.*encoding=[\'"](.*?)[\'"].*\?>')\
|
||||
.match(xml_data)
|
||||
if xml_encoding_match is None: # By Kovid to use the content-type header in HTML files
|
||||
xml_encoding_match = re.compile(r'<meta.*?http-equiv=[\'"]Content-type[\'"].*?content=[\'"].*?charset=(\S+).*?[\'"]', re.IGNORECASE).search(xml_data)
|
||||
xml_encoding_match = re.compile(r'<meta.*?content=[\'"].*?charset=(\S+).*?[\'"]', re.IGNORECASE).search(xml_data)
|
||||
except:
|
||||
xml_encoding_match = None
|
||||
if xml_encoding_match:
|
||||
|
Loading…
x
Reference in New Issue
Block a user