cenkalti/pyhtml — pull request #1 by hsoft (2013-06-28 13:56:09+00:00)
Title: Add support for unicode(tag)

Previously, calling unicode() on a tag with non-ascii characters would
result in a UnicodeDecodeError.

With this commit, there is still some implicit str-to-unicode conversion
going on during rendering because literals are in str rather than
unicode, but unlike render(), there's no mandatory utf-8 encoding and we
keep our unicode values unencoded.

This allows us, for example, to directly supply PyHTML tag to Django templates without having to explicitly call tag.render().decode('utf-8')