Is it possible to construct a String in java from invalid code points?
Is there any way a String str.getBytes("utf8") in java can return an invalid utf8 encoding?
The context is that I want to be able to serialize a String using an utf8 encoding as an array of bytes, and want to be able to deserialize it into as the same String.
I want to determine whether or not my (de)serialization code should first check if the array of bytes is a valid utf8 encoding or not.
Thank you.