ARKI_STRING_E002

thrownThis error is thrown. It stops your code unless you catch it. Fix the cause below; catching it only hides the problem.

What happened

Text or bytes are not valid UTF-8: an unpaired surrogate, an overlong form, a bad lead byte.

Fix

Pass well-formed text with no lone surrogates, or valid UTF-8 bytes. Encoding APIs return canonical failures; narrow with `isFailure`.

Check the fix

bun run test

Run it after the fix. It passes when the fix worked.

Where it comes from

Package
@arki/string
Version
0.3.0 · next release candidate
Source
src/errors.ts:22