struct UniString

A universal string containing string data and information about its encoding.

protected ubyte[] str

Byte string representation.

protected string encodingName

Name of string encoding.

ubyte[] getRawData()

Returns a current string as a byte array.

string getEncodingName()

Returns name of current encoding.

this(T)(T s)

Creates an instance from an encoded string.

this(string encoding, ubyte[] s)

Creates an instance by encoding name and byte representation.

string toString() const

Returns UTF-8 string representation.

T toEncodedString(T)()

Returns string of specified encoding by data type in compile time.

ubyte[] toEncodedString(string encodingName)

Returns string as byte array of specified encoding by data type.

void recode(T)()

Recodes current data of this UniString object into a new encoding by the string type passed as template parameter.

void recode(string encodingName)

Recodes current data of this UniString object to new encoding in runtime.

Parameters

encodingName

Name of new encoding of this string.

Variables

str

Byte string representation.

encodingName

Name of string encoding.

Methods

getRawData
getEncodingName
this
toString
toEncodedString
recode