ensureDecodeable

Wraps a text-based iopipe to make sure all code units are decodeable.

When an iopipe is made up of character types, in some cases a slice of the window may not be completely decodeable. For example, a wchar iopipe may have only one half of a surrogate pair at the end of the window.

This function generates an iopipe that only allows completely decodeable sequences to be released to the next iopipe.

ensureDecodeable
(
Chain
)
(
Chain c
)
if (
isIopipe!Chain &&
isSomeChar!(ElementEncodingType!(WindowType!Chain))
)

Parameters

c Chain

The iopipe whose element type is one of char, wchar, or dchar.

Return Value

Type: auto

An appropriate iopipe that ensures decodeability. Note that dchar iopipes are always decodeable, so the result is simply a return of the input.

Meta