Struct UTF16LEDecoder

UTF-16 LE decoder to use with dlib.text.encodings.transcode

struct UTF16LEDecoder ;

Fields

NameTypeDescription
character intCurrent character index
index ulongCurrent index in an input string
input stringInput string. Set it before decoding

Methods

NameDescription
decode () Range interface.
decodeNext () Decode next character.
eos () Check if decoder is in the end of input.

Example

wstring input = "Жå∑";
auto decoder = UTF16LEDecoder(cast(string)input);
assert(decoder.decodeNext() == 'Ж');
assert(decoder.decodeNext() == 'å');
assert(decoder.decodeNext() == '∑');