isValid

open override val isValid: Boolean(source)

true iff rawValue is well-formed UTF-8, via a canonical round-trip: value decodes rawValue (replacing any malformed sequence with U+FFFD), and re-encoding reproduces rawValue exactly iff the input was well-formed. Bytes that genuinely encode U+FFFD round-trip and are reported valid; malformed/overlong sequences re-encode differently and are reported invalid.

Limitation: the String constructor cannot observe malformed bytes (any Kotlin String is encodable), so it never rejects; byte-level validation is meaningful only for values decoded from ASN.1.