Handle invalid utf8 errors gracefully

An invalid UTF8 error should be converted to an error packet, IMO. It has the same behavior when another type of error happens.