summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander2008-10-25 08:14:47 +0000
committerMagnus Hagander2008-10-25 08:14:47 +0000
commit730bdd7b278c77707fb5ec2f8daa7f14e2e2766f (patch)
tree3ddd610ac256072b5d526613998388a0fe1c8965
parent809332c48235af192263994e231d89d0e4edf775 (diff)
Make tidy deal with utf8 properly. Oops.
git-svn-id: file:///Users/dpage/pgweb/svn-repo/trunk@2240 8f5c7a92-453e-0410-a47f-ad33c8a6b003
-rwxr-xr-xplanet/generator.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/planet/generator.py b/planet/generator.py
index d4d6e609..e12a6954 100755
--- a/planet/generator.py
+++ b/planet/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)