Skip to content

Commit

Permalink
Make tidy deal with utf8 properly. Oops.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhagander committed Oct 25, 2008
1 parent 7959feb commit 40194b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion generator.py
Expand Up @@ -28,6 +28,7 @@ def __init__(self,db):
output_xhtml=1,
show_body_only=1,
clean=1,
char_encoding='utf8',
)
self.items = []
self.feeds = []
Expand Down Expand Up @@ -73,7 +74,7 @@ def WriteFromTemplate(self, templatename, outputname):

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)
Expand Down

0 comments on commit 40194b1

Please sign in to comment.