dlib.text.encodings

Generic encoding tools

Description: 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)
}

Public Imports

dlib.text.utf8
public import dlib.text.utf8;
dlib.text.utf16
public import dlib.text.utf16;

Members

Functions

transcode
string transcode(string input)

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

Meta

Authors

Timur Gafarov