mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: Ensure CSS stylesheets are interpreted as UTF-8. Fixes #2021554 [The E-book viewer displays a CSS inserted em dash as an encoding error](https://bugs.launchpad.net/calibre/+bug/2021554)
This commit is contained in:
parent
bb3bb53270
commit
c5d4ece489
@ -149,6 +149,8 @@ class UrlSchemeHandler(QWebEngineUrlSchemeHandler):
|
|||||||
'application/x-font-truetype':'application/x-font-ttf',
|
'application/x-font-truetype':'application/x-font-ttf',
|
||||||
'application/font-sfnt': 'application/x-font-ttf',
|
'application/font-sfnt': 'application/x-font-ttf',
|
||||||
}.get(mime_type, mime_type)
|
}.get(mime_type, mime_type)
|
||||||
|
if mime_type == 'text/css':
|
||||||
|
mime_type += '; charset=utf-8'
|
||||||
send_reply(rq, mime_type, data)
|
send_reply(rq, mime_type, data)
|
||||||
except Exception:
|
except Exception:
|
||||||
import traceback
|
import traceback
|
||||||
|
Loading…
x
Reference in New Issue
Block a user