MessagePackValidateUTF8¶
Validates whether a string contains only valid UTF-8 byte
sequences. Returns true if the string is valid UTF-8,
false otherwise.
This is useful in the "decode then validate" pattern, where callers decode a string using a non-validating method and then validate separately so they retain access to the raw bytes on failure:
let s = MessagePackDecoder.str(reader)?
if not MessagePackValidateUTF8(s) then
// s still available — log, reject, or treat as raw bytes
end
Constructors¶
create¶
Returns¶
Public Functions¶
apply¶
Parameters¶
- s: String box
Returns¶
- Bool val
eq¶
Parameters¶
- that: MessagePackValidateUTF8 val
Returns¶
- Bool val
ne¶
Parameters¶
- that: MessagePackValidateUTF8 val
Returns¶
- Bool val