waylan/Python-Markdown — pull request #127 by svetlyak40wt (2012-07-26 12:49:08+00:00)
Title: Fixed UnicodeEncodeError when output from markdown_py is piped

When output is piped into another program, UnicodeEncodeError because Python 2.x can't determine system encoding.

To check this bug, try: `cat some.txt | markdown_py | cat'.

To fix the bug result have to be encoded into the output encoding explicitly, because sys.stdout.encoding is None, when piping data.