From 40194b17c06a0fb0696eaaeaf1db9d10d94b5d23 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Sat, 25 Oct 2008 08:14:47 +0000 Subject: [PATCH] Make tidy deal with utf8 properly. Oops. --- generator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generator.py b/generator.py index d4d6e60..e12a695 100755 --- a/generator.py +++ b/generator.py @@ -28,6 +28,7 @@ class Generator: output_xhtml=1, show_body_only=1, clean=1, + char_encoding='utf8', ) self.items = [] self.feeds = [] @@ -73,7 +74,7 @@ class Generator: def TruncateAndCleanDescription(self, txt): # First apply Tidy - txt = unicode(tidy.parseString(txt.encode('utf-8'), **self.tidyopts)) + txt = unicode(str(tidy.parseString(txt.encode('utf-8'), **self.tidyopts)),'utf8') # Then truncate as necessary ht = HtmlTruncator(1024) -- 2.39.5