handle cases where the exception is not encoded as UTF-8
fix for 1.8.7