Module dlib.text.encodings

Generic encoding tools


This module works with any encoder and decoder structs that implement the following basic interfaces:

struct Encoder
    // Encodes a Unicode code point to user-provided buffer.
    // Should return bytes written or 0 at error
    size_t encode(uint codePoint, char[] buffer)

struct Decoder
    // An input range that iterates characters of a string,
    // decoding them to Unicode code points
    auto decode(string input)


transcode(input) Converts a string from one encoding to another. Decoder and encoder are specified at compile time