test for UnicodeDecode/EncodeErrors instead of UnicodeError (thanks @hodgestar)