From 0c067c91511be1f607219c33942a1c1774c1c418 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 5 Jul 2009 12:26:44 -0600 Subject: [PATCH] MOBI Input: Correctly link stylesheet and declare encoding when converting to HTML --- src/calibre/ebooks/mobi/reader.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/reader.py b/src/calibre/ebooks/mobi/reader.py index fb01f665c0..8dc8d31150 100644 --- a/src/calibre/ebooks/mobi/reader.py +++ b/src/calibre/ebooks/mobi/reader.py @@ -345,10 +345,13 @@ class MobiReader(object): root.insert(0, head) head.text = '\n\t' link = head.makeelement('link', {'type':'text/css', - 'href':'styles.css'}) + 'href':'styles.css', 'rel':'stylesheet'}) head.insert(0, link) link.tail = '\n\t' title = head.xpath('descendant::title') + m = head.makeelement('meta', {'http-equiv':'Content-Type', + 'content':'text/html; charset=utf-8'}) + head.insert(0, m) if not title: title = head.makeelement('title', {}) title.text = self.book_header.title