themartorana/python-postmark — pull request #21 by mattrobenolt (2012-03-14 13:34:43+00:00)
Title: Cleanup whitespace, and only try conversion to unicode with PMJSONEncoder

Everything in Django should be assumed first as unicode. When trying to
convert an object down to a string that has a unicode character in it,
it will fail. And since fields from Django may very well have unicode
characters in them, this will fail consistently.

There's also no need to even try to convert to a string in this case.
Converting to unicode will work for plain strings too.