StringEncoderSequence

String encoder sequence. Runs a sequence of encoders over a string until one achieves a successful encoding.

Constructors

this
this()

Constructor. News an instance of each of the template types.

Members

Aliases

opCall
alias opCall = convert
Undocumented in source.

Functions

convert
mstring convert(cstring input, mstring output)

Runs the encoders in sequence until one succeeds.

Parameters

Encoders

tuple of types of encoders

Examples

alias StringEncode!("UTF-8", "UTF-8//TRANSLIT") Utf8Converter;
alias StringEncode!("ISO-8859-1", "UTF-8//TRANSLIT") Iso_8859_1_Converter;
alias StringEncoderSequence!(Utf8Converter, Iso_8859_1_Converter) Utf8Encoder;

Utf8Encoder utf8_encoder = new Utf8Encoder();
mstring buff;
utf8_encoder.convert("Soon\u2122", buff);
test(buff == "Soon™", buff);

Meta