Skip to content

MessagePackValidateUTF8

[Source]

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
primitive val MessagePackValidateUTF8

Constructors

create

[Source]

new val create()
: MessagePackValidateUTF8 val^

Returns


Public Functions

apply

[Source]

fun box apply(
  s: String box)
: Bool val

Parameters

Returns


eq

[Source]

fun box eq(
  that: MessagePackValidateUTF8 val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: MessagePackValidateUTF8 val)
: Bool val

Parameters

Returns