Added workaround for #1830: if an AssertionError gets passed a message
using unicode characters, the output resorts to __repr__() instead of
trying __str__ and failing with a UnicodeEncodeError.