Skip to content

Commit

Permalink
Fixed output encoding for HTML output (demonstrates usage of the enco…
Browse files Browse the repository at this point in the history
…ding argument to HTMLSerializer.serialize)

--HG--
extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40659
  • Loading branch information
tbroyer committed Jun 4, 2007
1 parent d2a2a36 commit 013bbae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ def printOutput(parser, document, opts):
sys.stdout.write(document.toxml("utf-8"))
elif opts.html:
tokens = treewalkers.getTreeWalker(opts.treebuilder)(document)
for text in serializer.HTMLSerializer().serialize(tokens):
sys.stdout.write(text.encode('utf-8'))
for text in serializer.HTMLSerializer().serialize(tokens, encoding='utf-8'):
sys.stdout.write(text)
elif opts.hilite:
sys.stdout.write(document.hilite("utf-8"))
else:
Expand Down

0 comments on commit 013bbae

Please sign in to comment.