Fix for "UnicodeEncodeError: 'ascii' codec can't encode character"

My server is configured to generate UTF-8 output, so trying to re-encode encoded UTF-8 characters outside of ASCII was causing the following error:

    UnicodeEncodeError: 'ascii' codec can't encode character u'\x.....' in position ...:


Here's my duct-tape fix: 354822bb7f284af397eb8bcfa5348a6df264bcc2
If you're interested in merging, I could do this properly. Otherwise, it works for me =)