Scrub the invalid paramter value before using it in the error #29793
You should be able to safely use the String error message. So when
I found this issue because due the way we parallelize CI runs, we end-up having to reply some error messages from one process to another, which we end-up having to do some string manipulation with error messages. However, in a broken test that was failing because of this error, we would get another error on top saying the Encoding of the String was invalid.
You should be able to safely use the String error message. So when finding the paramter has an invalid encoding we need to remove the invalid bytes before using it in the error. Otherwise the caller might get another Encoding error if they use the message.