convertText

Convert iopipe of one text type into an iopipe for another type. Performs conversions at the code-point level. If specified, the resulting iopipe will ensure there is a BOM at the beginning of the iopipe. This is useful if writing to storage.

If no conversion is necessary, and no BOM is required, the original iopipe is returned.

convertText
(
Char = char
bool ensureBOM = false
Chain
)
(
Chain chain
)
if (
isSomeChar!Char
)

Parameters

Char

The desired character type in the resulting iopipe. Must be one of char, wchar, or dchar.

ensureBOM

If true, the resulting iopipe will ALWAYS have a byte order mark at the beginning of the stream. At the moment this is accomplished by copying all the data from the original iopipe to the new one. A better mechanism is being worked on.

chain Chain

The source iopipe.

Return Value

Type: auto

An iopipe which fulfills the given requirements.

Meta