Prevent UnicodeDecodeErrors from being swallowed

UnicodeDecodeError is a subclass of ValueError, so these exceptions were being swallowed by the InvalidParameterError handling.