Rescue an invalid character exception when handling what appears to be badly encoded data.