Addresses Issue #964. The existing code would print an non ANSI character as a fallback character causing garbage in the output. This changes the code to use '?' as a fallback character when encoding fails.
I've got two patches for the issue, but have been unable to attach them. I've instead linked to the two files in issue #964.
Only one patch should be applied. One maintains legacy support (partially implemented at the moment) while the other is pure unicode. If the description in the issue is not adequate, I'm happy to answer any questions.
I've run both patches using a narrow build of Python 2.7 and in Python 3.3, and got expected results. Given direction for which patch is more desirable, I'd be happy to work with Gaurav on this pull request to fix the formatter and provide a suite of tests for the issues encountered.
Edit: Whoops! Just realized this pull request has already been merged. How should I proceed?